Skip to content

Commit

Permalink
chore: use codecov config and only send merged coverage file (#3751)
Browse files Browse the repository at this point in the history
* make sure config is used and only send merged coverage

Signed-off-by: Zach Aller <[email protected]>

* checkout repo to get codecov config

Signed-off-by: Zach Aller <[email protected]>

* use folder not file

Signed-off-by: Zach Aller <[email protected]>

* disable search

Signed-off-by: Zach Aller <[email protected]>

* switch merged output format

Signed-off-by: Zach Aller <[email protected]>

* stop controller before upload

Signed-off-by: Zach Aller <[email protected]>

* stop controller

Signed-off-by: Zach Aller <[email protected]>

* stop controller

Signed-off-by: Zach Aller <[email protected]>

* only stop on latest

Signed-off-by: Zach Aller <[email protected]>

* print controller pids

Signed-off-by: Zach Aller <[email protected]>

* fix erro

Signed-off-by: Zach Aller <[email protected]>

* add ls

Signed-off-by: Zach Aller <[email protected]>

* kill correct process

Signed-off-by: Zach Aller <[email protected]>

* add proper cover for unit to ues with merge

Signed-off-by: Zach Aller <[email protected]>

* upload directory now

Signed-off-by: Zach Aller <[email protected]>

---------

Signed-off-by: Zach Aller <[email protected]>
  • Loading branch information
zachaller authored Jul 29, 2024
1 parent e638c88 commit 3024c2a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3024c2a

Please sign in to comment.