From c013c58975489cb7a169ca31153d8cbdd1fd0ce4 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Fri, 13 Aug 2021 15:47:10 +0200 Subject: [PATCH 1/2] fix that CI go:embed test forever, again Signed-off-by: Pierre Fenoll --- .github/workflows/go.yml | 8 ++--- .gitignore | 2 ++ openapi3/testdata/go.mod | 5 --- openapi3/testdata/go.sum | 38 -------------------- openapi3/testdata/load_with_go_embed_test.go | 6 ++-- 5 files changed, 7 insertions(+), 52 deletions(-) delete mode 100644 openapi3/testdata/go.mod delete mode 100644 openapi3/testdata/go.sum diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index be19f943a..a45444e7e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -69,11 +69,9 @@ jobs: env: CGO_ENABLED: '1' - run: | - cd openapi3/testdata - go get -u -v github.com/getkin/kin-openapi - go test -tags with_embed ./... - git --no-pager diff && git checkout -- . - cd - + cp openapi3/testdata/load_with_go_embed_test.go openapi3/ + cat go.mod | sed 's%go 1.14%go 1.16%' >gomod && mv gomod go.mod + go test ./... if: matrix.go != '1.14' - if: runner.os == 'Linux' run: git --no-pager diff && [[ $(git --no-pager diff --name-only | wc -l) = 0 ]] diff --git a/.gitignore b/.gitignore index 31ab03fb6..caf95473b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ # IntelliJ / GoLand .idea + +/openapi3/load_with_go_embed_test.go diff --git a/openapi3/testdata/go.mod b/openapi3/testdata/go.mod deleted file mode 100644 index 21eab28a6..000000000 --- a/openapi3/testdata/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/getkin/kin-openapi/openapi3/testdata.test - -go 1.16 - -require github.com/getkin/kin-openapi v0.63.0 diff --git a/openapi3/testdata/go.sum b/openapi3/testdata/go.sum deleted file mode 100644 index 2795d3cbc..000000000 --- a/openapi3/testdata/go.sum +++ /dev/null @@ -1,38 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.52.0 h1:6WqsF5d6PfJ8AscdD+9Rtb2RP2iBWyC7V6GcjssWg7M= -github.com/getkin/kin-openapi v0.52.0/go.mod h1:fRpo2Nw4Czgy0QnrIesRrEXs5+15N1F9mGZLP/aIomE= -github.com/getkin/kin-openapi v0.61.0 h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.62.0 h1:qDGdXTLo20ANSgflJEYotfNzHGvYvilNogWOryEwRrI= -github.com/getkin/kin-openapi v0.62.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.63.0 h1:27zYoKAuHDSquDYRpfmgsDu9TKC5z5G4vlu/XmIdsa8= -github.com/getkin/kin-openapi v0.63.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/openapi3/testdata/load_with_go_embed_test.go b/openapi3/testdata/load_with_go_embed_test.go index 9cdace562..a5993dcc8 100644 --- a/openapi3/testdata/load_with_go_embed_test.go +++ b/openapi3/testdata/load_with_go_embed_test.go @@ -1,5 +1,3 @@ -//+build with_embed - package openapi3_test import ( @@ -10,7 +8,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" ) -//go:embed recursiveRef/* +//go:embed testdata/recursiveRef/* var fs embed.FS func Example() { @@ -20,7 +18,7 @@ func Example() { return fs.ReadFile(uri.Path) } - doc, err := loader.LoadFromFile("recursiveRef/openapi.yml") + doc, err := loader.LoadFromFile("testdata/recursiveRef/openapi.yml") if err != nil { panic(err) } From 1a44af044a0ad90d36c14771b03717dc1a9cea14 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Fri, 13 Aug 2021 15:53:26 +0200 Subject: [PATCH 2/2] eh Signed-off-by: Pierre Fenoll --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a45444e7e..96beea138 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -68,13 +68,13 @@ jobs: - run: go test -v -run TestRaceyPatternSchema -race ./... env: CGO_ENABLED: '1' + run: git --no-pager diff && [[ $(git --no-pager diff --name-only | wc -l) = 0 ]] - run: | cp openapi3/testdata/load_with_go_embed_test.go openapi3/ cat go.mod | sed 's%go 1.14%go 1.16%' >gomod && mv gomod go.mod go test ./... if: matrix.go != '1.14' - if: runner.os == 'Linux' - run: git --no-pager diff && [[ $(git --no-pager diff --name-only | wc -l) = 0 ]] - if: runner.os == 'Linux'