diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16eb4dfd2..c3637bd46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,12 @@ jobs: name: coverage-data-unit path: bin/coverage/unit/ if-no-files-found: error - + - + name: Unit Test Summary + uses: test-summary/action@v2 + with: + paths: bin/coverage/unit/report.xml + if: always() e2e: runs-on: ubuntu-latest strategy: @@ -202,7 +207,12 @@ jobs: rm -f /usr/local/bin/docker-compose cp bin/build/docker-compose /usr/local/bin make e2e-compose-standalone - + - + name: e2e Test Summary + uses: test-summary/action@v2 + with: + paths: /tmp/report/report.xml + if: always() coverage: runs-on: ubuntu-22.04 needs: diff --git a/Dockerfile b/Dockerfile index 51e4a52ff..529856386 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,11 +106,14 @@ RUN --mount=type=bind,target=. \ --mount=type=cache,target=/go/pkg/mod \ rm -rf /tmp/coverage && \ mkdir -p /tmp/coverage && \ - go test -tags "$BUILD_TAGS" -v -cover -covermode=atomic $(go list $(TAGS) ./... | grep -vE 'e2e') -args -test.gocoverdir="/tmp/coverage" && \ + rm -rf /tmp/report && \ + mkdir -p /tmp/report && \ + go run gotest.tools/gotestsum@latest --format testname --junitfile "/tmp/report/report.xml" -- -tags "$BUILD_TAGS" -v -cover -covermode=atomic $(go list $(TAGS) ./... | grep -vE 'e2e') -args -test.gocoverdir="/tmp/coverage" && \ go tool covdata percent -i=/tmp/coverage FROM scratch AS test-coverage COPY --from=test --link /tmp/coverage / +COPY --from=test --link /tmp/report / FROM base AS license-set ARG LICENSE_FILES diff --git a/Makefile b/Makefile index 2bce97090..df30dc860 100644 --- a/Makefile +++ b/Makefile @@ -75,11 +75,11 @@ 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 - go test -v $(TEST_FLAGS) -count=1 ./pkg/e2e + go run gotest.tools/gotestsum@latest --format testname --junitfile "/tmp/report/report.xml" -- -v $(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 - go test $(TEST_FLAGS) -v -count=1 -parallel=1 --tags=standalone ./pkg/e2e + go run gotest.tools/gotestsum@latest --format testname --junitfile "/tmp/report/report.xml" -- $(TEST_FLAGS) -v -count=1 -parallel=1 --tags=standalone ./pkg/e2e .PHONY: build-and-e2e-compose build-and-e2e-compose: build e2e-compose ## Compile the compose cli-plugin and run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a single test