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

ci: add windows runners #443

Merged
merged 6 commits into from
Jul 31, 2024
Merged

Conversation

YOU54F
Copy link
Member

@YOU54F YOU54F commented Jul 4, 2024

  • Added Windows x86_64 GitHub Action Runner

Caveats

Comment on lines +49 to +50
"CGO_LDFLAGS=-L$env:TMP" >> $env:GITHUB_ENV
"$env:TMP" >> $env:GITHUB_PATH
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documented in #442

.github/workflows/test.yml Outdated Show resolved Hide resolved
- name: Test (unit)
if: matrix.os != 'ubuntu-latest'
run: make test
- name: Test (pact)
if: matrix.os != 'ubuntu-latest'
run: make pact_local
- name: Install goveralls
if: matrix.os != 'windows-latest'
run: go install github.com/mattn/goveralls@latest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goveralls had an error on windows, but a yak shave for another day

@@ -61,10 +65,6 @@ clean:
rm -rf build output dist examples/pacts

deps: download_plugins
@echo "--- 🐿 Fetching build dependencies "
cd /tmp; \
go install github.com/mitchellh/gox@latest; \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't look to be used in this repo, and the repo is archived. May be a hangover from pact-go v1

@@ -11,6 +11,10 @@ PLUGIN_PACT_AVRO_VERSION=0.0.5

GO_VERSION?=1.22
ci:: docker deps clean bin test pact
PACT_DOWNLOAD_DIR=/tmp
ifeq ($(OS),Windows_NT)
PACT_DOWNLOAD_DIR=$$TMP
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use TMP var which is available in powershell and cmd prompt

consumer/http_v4_test.go Outdated Show resolved Hide resolved
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each plugin test split out into its own test, and assertions added

Copy link
Member Author

@YOU54F YOU54F Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each plugin test split out into its own test, and assertions added

rationale for splitting them up, was to isolate individual plugins, and re-enable them when trying to diagnose the shutdown failures on windows

})

assert.Error(t, err)
// assert.Equal(t, "Did not receive any requests for path 'PactPlugin/InitPlugin'", err)
Copy link
Member Author

@YOU54F YOU54F Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is suspect, where a consumer has setup as gRPC request, and the expected request hasn't been issued.

It previously didn't have an assertion and the error message isn't helpful to users

One would expect to see Did not receive any requests for path 'PactPlugin/InitPlugin'

synchronous_message_test.go:130:
	Error Trace:    /Users/saf/dev/pact-foundation/pact-go/message/v4/synchronous_message_test.go:130
	Error:
Not equal:
	expected: string("Did not receive any requests for path 'PactPlugin/InitPlugin'")
	actual  : *errors.errorString(&errors.errorString{s:"pact validation failed: [{Request:{Method: Path:PactPlugin/InitPlugin Query: Headers:map[] Body:<nil>} Mismatches:[] Type:}]"})				

The logs show a sane error, which I've multi-lined for readability

2024-07-04T01:36:33.745740Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: 
Got response: ShutdownMockServerResponse 
{ ok: false, 
results: [
MockServerResult 
{ 
path: "PactPlugin/InitPlugin", 
error: "Did not receive any requests for path 'PactPlugin/InitPlugin'", 
mismatches: [] }
] }

@coveralls
Copy link

Coverage Status

coverage: 29.358%. remained the same
when pulling fa1a0e2 on YOU54F:ci/win-runners
into fd44da5 on pact-foundation:master.

@coveralls
Copy link

Coverage Status

coverage: 29.383%. remained the same
when pulling f7d3a81 on YOU54F:ci/win-runners
into 6b135a1 on pact-foundation:master.

@YOU54F YOU54F requested a review from mefellows July 25, 2024 16:36
@YOU54F
Copy link
Member Author

YOU54F commented Jul 25, 2024

Should be good to go now, still got to look at the avro plugin loading on windows but that can be followed up later

@YOU54F YOU54F merged commit 6b525b4 into pact-foundation:master Jul 31, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants