mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
ci: upload unit and e2e coverage separately with Codecov flags (#28085)
Signed-off-by: Adam Saleh <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Claude Opus 4.6
parent
e36652ca57
commit
0401ef92e6
@@ -9,6 +9,11 @@ ignore:
|
||||
- "vendor/.*"
|
||||
- "test/.*"
|
||||
- "**/mocks/*"
|
||||
flags:
|
||||
unit-tests:
|
||||
carryforward: true
|
||||
e2e:
|
||||
carryforward: true
|
||||
coverage:
|
||||
status:
|
||||
# we've found this not to be useful
|
||||
|
||||
@@ -433,20 +433,39 @@ jobs:
|
||||
with:
|
||||
name: test-results
|
||||
path: test-results
|
||||
- name: combine-go-coverage
|
||||
- name: Generate unit test coverage profile
|
||||
# -pcombine allows merging coverage from different binaries whose counter
|
||||
# modes differ (main uses set, gitops-engine uses atomic due to -race).
|
||||
run: |
|
||||
mkdir -p test-results/merged
|
||||
go tool covdata merge -pcombine -i=test-results,test-results/gitops-engine -o test-results/merged
|
||||
go tool covdata textfmt -i=test-results/merged -o test-results/unit-coverage.out
|
||||
- name: Generate e2e test coverage profile
|
||||
# We generate coverage reports for all Argo CD components, but only the applicationset-controller,
|
||||
# app-controller, repo-server, and commit-server report contain coverage data. The other components currently
|
||||
# don't shut down gracefully, so no coverage data is produced. Once those components are fixed, we can add
|
||||
# references to their coverage output directories.
|
||||
run: |
|
||||
go tool covdata percent -i=test-results,e2e-code-coverage/applicationset-controller,e2e-code-coverage/repo-server,e2e-code-coverage/app-controller,e2e-code-coverage/commit-server -o test-results/full-coverage.out
|
||||
- name: Upload code coverage information to codecov.io
|
||||
# Only run when the workflow is for upstream (PR target or push is in argoproj/argo-cd).
|
||||
go tool covdata textfmt -i=e2e-code-coverage/applicationset-controller,e2e-code-coverage/repo-server,e2e-code-coverage/app-controller,e2e-code-coverage/commit-server -o test-results/e2e-coverage.out
|
||||
- name: Upload unit test coverage to codecov.io
|
||||
if: github.repository == 'argoproj/argo-cd'
|
||||
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||
with:
|
||||
version: v11.2.8 # https://github.com/getsentry/prevent-cli/releases/tag/v11.2.8
|
||||
files: test-results/full-coverage.out
|
||||
files: test-results/unit-coverage.out
|
||||
flags: unit-tests
|
||||
disable_search: true
|
||||
fail_ci_if_error: true
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
- name: Upload e2e test coverage to codecov.io
|
||||
if: github.repository == 'argoproj/argo-cd'
|
||||
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||
with:
|
||||
version: v11.2.8 # https://github.com/getsentry/prevent-cli/releases/tag/v11.2.8
|
||||
files: test-results/e2e-coverage.out
|
||||
flags: e2e
|
||||
disable_search: true
|
||||
fail_ci_if_error: true
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
@@ -458,8 +458,8 @@ endif
|
||||
test-gitops-engine:
|
||||
# run if TEST_MODULE is empty or points to gitops-engine tests
|
||||
ifneq ($(if $(TEST_MODULE),,ALL)$(filter github.com/argoproj/argo-cd/gitops-engine% ./gitops-engine%,$(TEST_MODULE)),)
|
||||
mkdir -p $(PWD)/test-results
|
||||
cd gitops-engine && go test -race -cover ./... -args -test.gocoverdir="$(PWD)/test-results"
|
||||
mkdir -p $(PWD)/test-results/gitops-engine
|
||||
cd gitops-engine && go test -race -cover ./... -args -test.gocoverdir="$(PWD)/test-results/gitops-engine"
|
||||
endif
|
||||
|
||||
.PHONY: test-race
|
||||
|
||||
Reference in New Issue
Block a user