Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix that CI go:embed test forever, again #405

Merged
merged 2 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +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: |
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 ]]


- if: runner.os == 'Linux'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@

# IntelliJ / GoLand
.idea

/openapi3/load_with_go_embed_test.go
5 changes: 0 additions & 5 deletions openapi3/testdata/go.mod

This file was deleted.

38 changes: 0 additions & 38 deletions openapi3/testdata/go.sum

This file was deleted.

6 changes: 2 additions & 4 deletions openapi3/testdata/load_with_go_embed_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//+build with_embed

package openapi3_test

import (
Expand All @@ -10,7 +8,7 @@ import (
"github.com/getkin/kin-openapi/openapi3"
)

//go:embed recursiveRef/*
//go:embed testdata/recursiveRef/*
var fs embed.FS

func Example() {
Expand All @@ -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)
}
Expand Down