Skip to content

Commit

Permalink
ci(win): CGO_LDFLAGS / skip avro test
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jun 29, 2024
1 parent d69edee commit 5965a55
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- name: Test (unit)
run: make test
- name: Test (pact)
run: make pact_local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build consumer
//go:build darwin || linux || consumer
// +build consumer

package avro
Expand All @@ -10,7 +10,7 @@ import (
"net/url"
"os"
"testing"

"strings"
"github.com/pact-foundation/pact-go/v2/consumer"

"path/filepath"
Expand All @@ -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 + `",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build provider
//go:build darwin || linux || provider
// +build provider

package avro
Expand All @@ -7,7 +7,6 @@ import (
"fmt"
"log"
"net/http"

"os"
"path/filepath"
"testing"
Expand Down
8 changes: 4 additions & 4 deletions examples/grpc/grpc_consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path/filepath"
"testing"
"time"

"strings"
"github.com/hashicorp/logutils"

"github.com/pact-foundation/pact-go/v2/examples/grpc/routeguide"
Expand All @@ -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 + `",
Expand Down Expand Up @@ -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 + `",
Expand Down Expand Up @@ -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 + `",
Expand Down
4 changes: 2 additions & 2 deletions examples/protobuf-message/protobuf_consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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 + `",
Expand Down

0 comments on commit 5965a55

Please sign in to comment.