Skip to content

Commit e37432b

Browse files
Merge pull request #68 from RandomProgramm3r/develop
fix(ci): Correct Codecov reporting and file discovery This commit resolves a critical issue where Codecov was reporting inaccurate coverage metrics due to missing source files. The CI workflow has been updated to ensure all relevant files are discovered and processed correctly. Key changes: - The `coverage run` command now explicitly specifies the source directory (`--source='.'`) and the target applications (`business`, `core`, `user`). This forces `coverage` to analyze all relevant files, not just those touched by tests, fixing the incorrect file and line counts in Codecov reports. - The path to the `.coveragerc` configuration file is now correctly specified, ensuring custom settings are applied. - The Codecov GitHub Action is now configured with the correct `directory` to locate the `coverage.xml` report. - The entire test and coverage generation command has been streamlined for better clarity and reliability.
2 parents 78dedb7 + 4b62a94 commit e37432b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Run tests and generate coverage report 🛡️
6767
run: >
6868
docker compose exec -T web sh -c
69-
"cd promo_code && coverage run --rcfile=.coveragerc manage.py test && coverage xml"
69+
"coverage run --rcfile=promo_code/.coveragerc --source='.' promo_code/manage.py test business core user && coverage xml -o promo_code/coverage.xml"
7070
7171
- name: Copy coverage report from container 📂
7272
run: docker compose cp web:/usr/src/app/promo_code/coverage.xml ./coverage.xml
@@ -75,4 +75,5 @@ jobs:
7575
uses: codecov/codecov-action@v5
7676
with:
7777
token: ${{ secrets.CODECOV_TOKEN }}
78+
directory: promo_code
7879
fail_ci_if_error: true

0 commit comments

Comments
 (0)