From 3024c2a6fbc5e98911e6b38c39987534f593cfe5 Mon Sep 17 00:00:00 2001 From: Zach Aller Date: Mon, 29 Jul 2024 14:59:33 -0500 Subject: [PATCH] chore: use codecov config and only send merged coverage file (#3751) * make sure config is used and only send merged coverage Signed-off-by: Zach Aller * checkout repo to get codecov config Signed-off-by: Zach Aller * use folder not file Signed-off-by: Zach Aller * disable search Signed-off-by: Zach Aller * switch merged output format Signed-off-by: Zach Aller * stop controller before upload Signed-off-by: Zach Aller * stop controller Signed-off-by: Zach Aller * stop controller Signed-off-by: Zach Aller * only stop on latest Signed-off-by: Zach Aller * print controller pids Signed-off-by: Zach Aller * fix erro Signed-off-by: Zach Aller * add ls Signed-off-by: Zach Aller * kill correct process Signed-off-by: Zach Aller * add proper cover for unit to ues with merge Signed-off-by: Zach Aller * upload directory now Signed-off-by: Zach Aller --------- Signed-off-by: Zach Aller --- .github/workflows/testing.yaml | 19 ++++++++++++++++--- Makefile | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index d9862e5726..7c4282bea7 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -72,7 +72,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage-output-unit - path: coverage-output-unit/coverage.out + path: coverage-output-unit test-e2e: strategy: @@ -123,8 +123,17 @@ jobs: uses: mxschmitt/action-tmate@v3 if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true'}} - name: Run e2e tests - run: make test-e2e + run: | + make test-e2e if: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true') }} + - name: Stop e2e tests controller + run: | + pgrep -f go-build -a + pkill -f go-build + sleep 5 + echo "done stopping process" + ls -lah coverage-output-e2e/ + if: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' && matrix.kubernetes.latest)}} - name: Output Rerun Overview run: | [[ -f rerunreport.txt ]] && cat rerunreport.txt || echo "No rerun report found" @@ -160,6 +169,7 @@ jobs: with: go-version: ${{ env.GOLANG_VERSION }} id: go + - uses: actions/checkout@v4 - name: Get e2e code coverage uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: @@ -172,11 +182,14 @@ jobs: path: coverage-output-unit - name: combine-go-coverage run: | - go tool covdata percent -i=coverage-output-unit/,coverage-output-e2e/ -o full-coverage.out + go tool covdata textfmt -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 + codecov_yml_path: .codecov.yml + disable_search: true + verbose: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/Makefile b/Makefile index 5f4ae3ded2..55b21af87c 100644 --- a/Makefile +++ b/Makefile @@ -245,7 +245,7 @@ test-e2e: install-devtools-local .PHONY: test-unit test-unit: install-devtools-local ## run unit tests mkdir -p coverage-output-unit - ${DIST_DIR}/gotestsum --junitfile=junit-unit-test.xml --format=testname -- -covermode=count -coverprofile=coverage-output-unit/coverage.out `go list ./... | grep -v ./test/cmd/metrics-plugin-sample` + ${DIST_DIR}/gotestsum --junitfile=junit-unit-test.xml --format=testname -- `go list ./... | grep -v ./test/cmd/metrics-plugin-sample` -cover -test.gocoverdir=$(CURDIR)/coverage-output-unit .PHONY: coverage