diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 931e94757..3a835eda8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -142,15 +142,15 @@ jobs: with: distribution: temurin java-version: 17 - # - name: Set LDFLAGS - # run: | - # "LDFLAGS=-LC:/Users/RUNNER~1/AppData/Local/Temp" >> $env:GITHUB_ENV + - name: Set CGO_LDFLAGS + run: | + "CGO_LDFLAGS=$env:TMP" >> $env:GITHUB_ENV - name: Add pact_ffi lib location to path run: | - $env:Path += ';$env:TMP';$env:LDFLAGS = '-L$env:TMP';make test + "$env:TMP" >> $env:GITHUB_PATH # - name: Install # run: make install - # - name: Test (unit) - # run: make test - # - name: Test (pact) - # run: make pact_local \ No newline at end of file + - name: Test (unit) + run: make test + - name: Test (pact) + run: make pact_local \ No newline at end of file diff --git a/examples/avro/avro_consumer_test.go b/examples/avro/avro_consumer_test_unix.go similarity index 94% rename from examples/avro/avro_consumer_test.go rename to examples/avro/avro_consumer_test_unix.go index 07111c749..2bb2fa78d 100644 --- a/examples/avro/avro_consumer_test.go +++ b/examples/avro/avro_consumer_test_unix.go @@ -1,4 +1,4 @@ -//go:build consumer +//go:build darwin || linux || consumer // +build consumer package avro @@ -10,7 +10,7 @@ import ( "net/url" "os" "testing" - + "strings" "github.com/pact-foundation/pact-go/v2/consumer" "path/filepath" @@ -29,7 +29,7 @@ func TestAvroHTTP(t *testing.T) { assert.NoError(t, err) dir, _ := os.Getwd() - path := fmt.Sprintf("%s/user.avsc", dir) + path := fmt.Sprintf("%s/user.avsc", strings.ReplaceAll(dir, "\\", "/")) avroResponse := `{ "pact:avro": "` + path + `", diff --git a/examples/avro/avro_provider_test.go b/examples/avro/avro_provider_test_unix.go similarity index 97% rename from examples/avro/avro_provider_test.go rename to examples/avro/avro_provider_test_unix.go index d8cbaf331..b9a56f325 100644 --- a/examples/avro/avro_provider_test.go +++ b/examples/avro/avro_provider_test_unix.go @@ -1,4 +1,4 @@ -//go:build provider +//go:build darwin || linux || provider // +build provider package avro @@ -7,7 +7,6 @@ import ( "fmt" "log" "net/http" - "os" "path/filepath" "testing" diff --git a/examples/grpc/grpc_consumer_test.go b/examples/grpc/grpc_consumer_test.go index 58fae546e..873a9be79 100644 --- a/examples/grpc/grpc_consumer_test.go +++ b/examples/grpc/grpc_consumer_test.go @@ -10,7 +10,7 @@ import ( "path/filepath" "testing" "time" - + "strings" "github.com/hashicorp/logutils" "github.com/pact-foundation/pact-go/v2/examples/grpc/routeguide" @@ -35,7 +35,7 @@ func TestGetFeatureSuccess(t *testing.T) { log.SetLogLevel(logutils.LogLevel(logLevel)) dir, _ := os.Getwd() - path := fmt.Sprintf("%s/routeguide/route_guide.proto", dir) + path := fmt.Sprintf("%s/routeguide/route_guide.proto", strings.ReplaceAll(dir, "\\", "/")) grpcInteraction := `{ "pact:proto": "` + path + `", @@ -112,7 +112,7 @@ func TestGetFeatureError(t *testing.T) { }) dir, _ := os.Getwd() - path := fmt.Sprintf("%s/routeguide/route_guide.proto", dir) + path := fmt.Sprintf("%s/routeguide/route_guide.proto", strings.ReplaceAll(dir, "\\", "/")) grpcInteraction := `{ "pact:proto": "` + path + `", @@ -181,7 +181,7 @@ func TestSaveFeature(t *testing.T) { log.SetLogLevel(logutils.LogLevel(logLevel)) dir, _ := os.Getwd() - path := fmt.Sprintf("%s/routeguide/route_guide.proto", dir) + path := fmt.Sprintf("%s/routeguide/route_guide.proto", strings.ReplaceAll(dir, "\\", "/")) grpcInteraction := `{ "pact:proto": "` + path + `", diff --git a/examples/protobuf-message/protobuf_consumer_test.go b/examples/protobuf-message/protobuf_consumer_test.go index 269c59054..8e5c5f6cc 100644 --- a/examples/protobuf-message/protobuf_consumer_test.go +++ b/examples/protobuf-message/protobuf_consumer_test.go @@ -8,7 +8,7 @@ import ( "os" "path/filepath" "testing" - + "strings" message "github.com/pact-foundation/pact-go/v2/message/v4" "github.com/stretchr/testify/assert" ) @@ -23,7 +23,7 @@ func TestPluginMessageConsumer(t *testing.T) { }) dir, _ := os.Getwd() - path := fmt.Sprintf("%s/../grpc/routeguide/route_guide.proto", dir) + path := fmt.Sprintf("%s/../grpc/routeguide/route_guide.proto", strings.ReplaceAll(dir, "\\", "/")) protoMessage := `{ "pact:proto": "` + path + `",