From a818a01a13c04cff5dc89c3ce92fa2cbc4217ce3 Mon Sep 17 00:00:00 2001 From: Blaine Gardner Date: Fri, 16 Apr 2021 11:49:06 -0600 Subject: [PATCH] test: do not allow go.test parallel dependencies Dependencies for `make go.test` have to run in order, so call them explicitly from the target rather than allowing them to be done in parallel if `make -j` flag is used. Signed-off-by: Blaine Gardner --- .github/workflows/unit-test.yml | 2 ++ build/makelib/golang.mk | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index e45c2d565..8134d4835 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -3,6 +3,8 @@ on: pull_request: paths: - '**.go' + - build/makelib/golang.mk + - Makefile jobs: unittests: diff --git a/build/makelib/golang.mk b/build/makelib/golang.mk index 3486fee5a..7ab0c69b0 100644 --- a/build/makelib/golang.mk +++ b/build/makelib/golang.mk @@ -127,8 +127,11 @@ go.install: @echo === go install $(PLATFORM) $(foreach p,$(GO_STATIC_PACKAGES),@CGO_ENABLED=0 $(GO) install -v $(GO_STATIC_FLAGS) $(p)${\n}) +# GOJUNIT and go.mod.vendor need to happen in order and NOT in parallel, so call them explicitly .PHONY: go.test.unit -go.test.unit: $(GOJUNIT) go.mod.vendor +go.test.unit: + @$(MAKE) $(GOJUNIT) + @$(MAKE) go.mod.vendor @echo === go test unit-tests @mkdir -p $(GO_TEST_OUTPUT) CGO_ENABLED=0 $(GOHOST) test -v -cover $(GO_STATIC_FLAGS) $(GO_PACKAGES)