CodeCoverageSummary
CodeCoverageSummary copied to clipboard
How to get coverage per file
Please, can you help me find how I can get more detailed information in the report?
I use Coverage.py to generate the coverage.cobertura.xml
file which does actually contain the information per file in the directory not just the overall score.
This is part of my Github Actions setup:
- name: Test docker
run: |
docker run \
--rm --volumes-from github_runner \
${{ env.TEST_TAG }} \
/bin/bash -c \
"python -m coverage run --data-file=/cov/.coverage --branch -m pytest; python -m coverage xml --data-file=/cov/.coverage -o ${RUNNER_WORKDIR}/cov/coverage.cobertura.xml"
- name: Copy files to workdir
run: |
cp ${RUNNER_WORKDIR}/cov/coverage.cobertura.xml ${GITHUB_WORKSPACE}/coverage.cobertura.xml
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage.cobertura.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
Maybe I'm just missing something simple but it seems the docs are not really stating how to do this and from the issues it seems people are able to get them, so how would I have to change my setup?
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days.
No, don't close, there is clearly more interest than just me without any response.
Also experiencing this with Node.js and the cobertura output of c8. The c8 command outputs per-file coverage and the xml definitely contain per-file coverage as classes but code-coverage-summary only prints per-folder coverage.