Skip to content

Commit

Permalink
Make one of the go2idl unit tests pass in a sandbox.
Browse files Browse the repository at this point in the history
  • Loading branch information
spxtr committed Dec 22, 2016
1 parent 20003bd commit 8ce98ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
5 changes: 1 addition & 4 deletions cmd/libs/go2idl/openapi-gen/generators/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ go_test(
name = "go_default_test",
srcs = ["openapi_test.go"],
library = "go_default_library",
tags = [
"automanaged",
"skip",
],
tags = ["automanaged"],
deps = [
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/gengo/generator",
Expand Down
26 changes: 2 additions & 24 deletions cmd/libs/go2idl/openapi-gen/generators/openapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ func TestSimple(t *testing.T) {
err, assert, buffer := testOpenAPITypeWritter(t, `
package foo
import (
"time"
"k8s.io/kubernetes/pkg/util/intstr"
)
// Blah is a test.
// +k8s:openapi=true
type Blah struct {
Expand Down Expand Up @@ -110,12 +105,8 @@ type Blah struct {
Float64 float64
// A simple float32
Float32 float32
// A simple time
Time time.Time
// a base64 encoded characters
ByteArray []byte
// an int or string type
IntOrString intstr.IntOrString
}
`)
if err != nil {
Expand Down Expand Up @@ -224,32 +215,19 @@ Type: []string{"number"},
Format: "float",
},
},
"Time": {
SchemaProps: spec.SchemaProps{
Description: "A simple time",
Type: []string{"string"},
Format: "date-time",
},
},
"ByteArray": {
SchemaProps: spec.SchemaProps{
Description: "a base64 encoded characters",
Type: []string{"string"},
Format: "byte",
},
},
"IntOrString": {
SchemaProps: spec.SchemaProps{
Description: "an int or string type",
Ref: spec.MustCreateRef("#/definitions/intstr.IntOrString"),
},
},
},
Required: []string{"String","Int64","Int32","Int16","Int8","Uint","Uint64","Uint32","Uint16","Uint8","Byte","Bool","Float64","Float32","Time","ByteArray","IntOrString"},
Required: []string{"String","Int64","Int32","Int16","Int8","Uint","Uint64","Uint32","Uint16","Uint8","Byte","Bool","Float64","Float32","ByteArray"},
},
},
Dependencies: []string{
"intstr.IntOrString",},
},
},
`, buffer.String())
}
Expand Down

0 comments on commit 8ce98ba

Please sign in to comment.