From 3b85cd2fa9a185b56996f3a4aaea92b9d5ef96fd Mon Sep 17 00:00:00 2001 From: Milas Bowman Date: Fri, 24 Mar 2023 11:25:40 -0400 Subject: [PATCH] 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 --- .github/workflows/ci.yml | 6 +++++- Makefile | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3888c0d95..3bc7de518 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,7 +179,11 @@ jobs: name: Test plugin mode if: ${{ matrix.mode == 'plugin' }} run: | - make e2e-compose + rm -rf ./covdatafiles + mkdir ./covdatafiles + make e2e-compose GOCOVERDIR=covdatafiles + go tool covdata textfmt -i=covdatafiles -o=coverage.out + - name: Test standalone mode if: ${{ matrix.mode == 'standalone' }} diff --git a/Makefile b/Makefile index cbff75ffb..e31e75286 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ ifeq ($(OS),Windows_NT) else DETECTED_OS = $(shell uname -s) endif + ifeq ($(DETECTED_OS),Linux) MOBY_DOCKER=/usr/bin/docker endif @@ -71,10 +72,7 @@ install: binary .PHONY: e2e-compose e2e-compose: ## Run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a single test - rm -rf covdatafiles - mkdir covdatafiles - GOCOVERDIR=covdatafiles go test $(TEST_FLAGS) -count=1 ./pkg/e2e - go tool covdata textfmt -i=covdatafiles -o=coverage.out + go test $(TEST_FLAGS) -count=1 ./pkg/e2e .PHONY: e2e-compose-standalone e2e-compose-standalone: ## Run End to end local tests in standalone mode. Set E2E_TEST=TestName to run a single test