Skip to content

Commit 6d496bc

Browse files
PBM coverage report for functional tests
1 parent b1fc636 commit 6d496bc

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
PBM_BRANCH: ${{ github.event.inputs.pbm_branch || 'main' }}
3939
GO_VER: ${{ github.event.inputs.go_ver || '1.22-bullseye' }}
4040
PR_NUMBER: ${{ github.event.number|| github.event.inputs.pr_ver }}
41-
41+
MAKE_TARGET: 'build-cover'
4242
steps:
4343
- name: Checkout testing repo
4444
uses: actions/checkout@v4
@@ -58,8 +58,50 @@ jobs:
5858
docker compose run test pytest -s --junitxml=junit.xml -k ${{ matrix.test }}
5959
working-directory: psmdb-testing/pbm-functional/pytest
6060

61+
- name: Fetch coverage files
62+
run: |
63+
docker compose run --rm golang_reports cp -r /gocoverdir/reports /test
64+
sudo chmod -R 777 reports
65+
working-directory: psmdb-testing/pbm-functional/pytest
66+
if: success() || failure()
67+
68+
- name: Upload coverage reports
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: reports-${{ matrix.test }}-${{ matrix.psmdb }}
72+
path: psmdb-testing/pbm-functional/pytest/reports/
73+
if: success() || failure()
74+
6175
- name: Publish Test Report
6276
uses: mikepenz/action-junit-report@v4
6377
if: success() || failure()
6478
with:
6579
report_paths: "**/junit.xml"
80+
81+
coverage:
82+
if: ${{ always() }}
83+
needs: test
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Set up Go
88+
uses: actions/setup-go@v5
89+
with:
90+
go-version-file: 'go.mod'
91+
check-latest: true
92+
- name: Download all coverage reports
93+
uses: actions/download-artifact@v4
94+
with:
95+
path: reports
96+
pattern: reports-*
97+
merge-multiple: true
98+
- name: Merge coverage reports
99+
run: |
100+
go tool covdata textfmt -i=./reports -o ./coverage.txt
101+
- name: Upload coverage to Codecov
102+
uses: codecov/codecov-action@v3
103+
with:
104+
files: ./coverage.txt
105+
flags: integration
106+
fail_ci_if_error: false
107+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ jobs:
2121
uses: codecov/codecov-action@v4
2222
with:
2323
file: cover.out
24+
flags: unittests
2425
fail_ci_if_error: false
2526
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)