From 85ff2efd83c8c0cef24b4649dc994c659e03d1d3 Mon Sep 17 00:00:00 2001 From: Zach Aller Date: Tue, 23 Jul 2024 11:41:09 -0500 Subject: [PATCH] change folder names Signed-off-by: Zach Aller --- .github/workflows/e2e.yaml | 22 ++++++++++++++++------ .gitignore | 3 ++- Makefile | 7 ++++--- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index bec468759b..a8f91b9153 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -146,8 +146,8 @@ jobs: - name: Generate code coverage artifacts uses: actions/upload-artifact@v4 with: - name: e2e-coverage-output - path: e2e-coverage-output + name: coverage-output-e2e + path: coverage-output-e2e coverage-process: name: Run end-to-end tests runs-on: ubuntu-latest @@ -163,10 +163,20 @@ jobs: - name: Get e2e code coverage uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: - name: e2e-coverage-output - path: e2e-coverage-output + name: coverage-output-e2e + path: coverage-output-e2e - name: Get unit test code coverage uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: - name: code-coverage - path: coverage.out \ No newline at end of file + name: coverage-output-unit + path: coverage-output-unit + - name: combine-go-coverage + run: | + go tool covdata percent -i=coverage-output-unit/,coverage-output-e2e/ -o full-coverage.out + - name: Upload code coverage information to codecov.io + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 + with: + file: full-coverage.out + fail_ci_if_error: false + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index d47bc8fa18..ab4b2ac69e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ plugin-bin/ # static server/static/* !server/static/.gitkeep -e2e-coverage-output/ +coverage-output-e2e/ +coverage-output-unit/ diff --git a/Makefile b/Makefile index 9aad6dfd4a..d6244ecf82 100644 --- a/Makefile +++ b/Makefile @@ -235,8 +235,8 @@ test-kustomize: ## run kustomize tests .PHONY: start-e2e start-e2e: ## start e2e test environment - mkdir -p e2e-coverage-output - GOCOVERDIR=e2e-coverage-output go run -cover ./cmd/rollouts-controller/main.go --instance-id ${E2E_INSTANCE_ID} --loglevel debug --kloglevel 6 + mkdir -p coverage-output-e2e + GOCOVERDIR=coverage-output-e2e go run -cover ./cmd/rollouts-controller/main.go --instance-id ${E2E_INSTANCE_ID} --loglevel debug --kloglevel 6 .PHONY: test-e2e test-e2e: install-devtools-local @@ -244,7 +244,8 @@ test-e2e: install-devtools-local .PHONY: test-unit test-unit: install-devtools-local ## run unit tests - ${DIST_DIR}/gotestsum --junitfile=junit.xml --format=testname -- -covermode=count -coverprofile=coverage.out `go list ./... | grep -v ./test/cmd/metrics-plugin-sample` + mkdir -p coverage-output-unit + ${DIST_DIR}/gotestsum --junitfile=junit.xml --format=testname -- -covermode=count -coverprofile=coverage-output-unit/coverage.out `go list ./... | grep -v ./test/cmd/metrics-plugin-sample` .PHONY: coverage