Skip to content

Commit 2720674

Browse files
Agentlubomir
authored andcommitted
Add test coverage measurement and CodeCov upload to CI
- Add --cov-report=xml to the pytest command in tox.ini so pytest-cov generates coverage.xml on every test run. - Install git-core (minimal git package) in the CI container so the codecov action can read repository metadata. - Add permissions: id-token: write to the tests job for OIDC token access. - Add codecov/codecov-action@v5 step to upload coverage.xml to CodeCov. Generated-By: OpenCode (google-vertex-anthropic/claude-sonnet-4-6@default)
1 parent 6552ee2 commit 2720674

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/gating.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
tests:
1111

1212
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
1315
container:
1416
image: quay.io/exd-guild-compose/cts:latest
1517

@@ -20,6 +22,7 @@ jobs:
2022
sudo dnf update -y &&
2123
sudo dnf install -y
2224
findutils
25+
git-core
2326
make
2427
python3-ldap
2528
python3-mock
@@ -35,3 +38,9 @@ jobs:
3538
run: tox -e docs
3639
- name: tests
3740
run: tox -e py3
41+
- uses: codecov/codecov-action@v5
42+
with:
43+
use_oidc: true
44+
flags: unit-tests
45+
files: ./coverage.xml
46+
fail_ci_if_error: false

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ commands =
1919
-W "ignore:inspect.getargspec:DeprecationWarning" \
2020
-W "ignore:This method will be removed in future versions. Use 'parser.read_file()':DeprecationWarning" \
2121
-W "ignore:Use .persist_selectable:DeprecationWarning" \
22+
--cov-report=xml \
2223
{posargs}
2324
sitepackages = True
2425

0 commit comments

Comments
 (0)