Skip to content

Commit 3b85cd2

Browse files
committed
test: fix e2e commands on Windows
Instead of trying to make this work nicely cross-platform, just push the Coverage logic into the GitHub Actions job, as that's really where we care about it. (It's surprisingly difficult to make this nicely portable; to make PowerShell not error out if the path does not exist you have to ignore ALL errors and the way that env vars are passed to processes is not the same.) Signed-off-by: Milas Bowman <[email protected]>
1 parent d818bf6 commit 3b85cd2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ jobs:
179179
name: Test plugin mode
180180
if: ${{ matrix.mode == 'plugin' }}
181181
run: |
182-
make e2e-compose
182+
rm -rf ./covdatafiles
183+
mkdir ./covdatafiles
184+
make e2e-compose GOCOVERDIR=covdatafiles
185+
go tool covdata textfmt -i=covdatafiles -o=coverage.out
186+
183187
-
184188
name: Test standalone mode
185189
if: ${{ matrix.mode == 'standalone' }}

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ifeq ($(OS),Windows_NT)
2323
else
2424
DETECTED_OS = $(shell uname -s)
2525
endif
26+
2627
ifeq ($(DETECTED_OS),Linux)
2728
MOBY_DOCKER=/usr/bin/docker
2829
endif
@@ -71,10 +72,7 @@ install: binary
7172

7273
.PHONY: e2e-compose
7374
e2e-compose: ## Run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a single test
74-
rm -rf covdatafiles
75-
mkdir covdatafiles
76-
GOCOVERDIR=covdatafiles go test $(TEST_FLAGS) -count=1 ./pkg/e2e
77-
go tool covdata textfmt -i=covdatafiles -o=coverage.out
75+
go test $(TEST_FLAGS) -count=1 ./pkg/e2e
7876

7977
.PHONY: e2e-compose-standalone
8078
e2e-compose-standalone: ## Run End to end local tests in standalone mode. Set E2E_TEST=TestName to run a single test

0 commit comments

Comments
 (0)