Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
8ce98ba3
Commit
8ce98ba3
authored
Dec 21, 2016
by
Joe Finney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make one of the go2idl unit tests pass in a sandbox.
parent
20003bdc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
28 deletions
+3
-28
BUILD
cmd/libs/go2idl/openapi-gen/generators/BUILD
+1
-4
openapi_test.go
cmd/libs/go2idl/openapi-gen/generators/openapi_test.go
+2
-24
No files found.
cmd/libs/go2idl/openapi-gen/generators/BUILD
View file @
8ce98ba3
...
@@ -26,10 +26,7 @@ go_test(
...
@@ -26,10 +26,7 @@ go_test(
name = "go_default_test",
name = "go_default_test",
srcs = ["openapi_test.go"],
srcs = ["openapi_test.go"],
library = "go_default_library",
library = "go_default_library",
tags = [
tags = ["automanaged"],
"automanaged",
"skip",
],
deps = [
deps = [
"//vendor:github.com/stretchr/testify/assert",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/gengo/generator",
"//vendor:k8s.io/gengo/generator",
...
...
cmd/libs/go2idl/openapi-gen/generators/openapi_test.go
View file @
8ce98ba3
...
@@ -70,11 +70,6 @@ func TestSimple(t *testing.T) {
...
@@ -70,11 +70,6 @@ func TestSimple(t *testing.T) {
err
,
assert
,
buffer
:=
testOpenAPITypeWritter
(
t
,
`
err
,
assert
,
buffer
:=
testOpenAPITypeWritter
(
t
,
`
package foo
package foo
import (
"time"
"k8s.io/kubernetes/pkg/util/intstr"
)
// Blah is a test.
// Blah is a test.
// +k8s:openapi=true
// +k8s:openapi=true
type Blah struct {
type Blah struct {
...
@@ -110,12 +105,8 @@ type Blah struct {
...
@@ -110,12 +105,8 @@ type Blah struct {
Float64 float64
Float64 float64
// A simple float32
// A simple float32
Float32 float32
Float32 float32
// A simple time
Time time.Time
// a base64 encoded characters
// a base64 encoded characters
ByteArray []byte
ByteArray []byte
// an int or string type
IntOrString intstr.IntOrString
}
}
`
)
`
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -224,13 +215,6 @@ Type: []string{"number"},
...
@@ -224,13 +215,6 @@ Type: []string{"number"},
Format: "float",
Format: "float",
},
},
},
},
"Time": {
SchemaProps: spec.SchemaProps{
Description: "A simple time",
Type: []string{"string"},
Format: "date-time",
},
},
"ByteArray": {
"ByteArray": {
SchemaProps: spec.SchemaProps{
SchemaProps: spec.SchemaProps{
Description: "a base64 encoded characters",
Description: "a base64 encoded characters",
...
@@ -238,18 +222,12 @@ Type: []string{"string"},
...
@@ -238,18 +222,12 @@ Type: []string{"string"},
Format: "byte",
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","ByteArray"},
Required: []string{"String","Int64","Int32","Int16","Int8","Uint","Uint64","Uint32","Uint16","Uint8","Byte","Bool","Float64","Float32","Time","ByteArray","IntOrString"},
},
},
},
},
Dependencies: []string{
Dependencies: []string{
"intstr.IntOrString",
},
},
},
},
`
,
buffer
.
String
())
`
,
buffer
.
String
())
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment