Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get coverage per file #236

Open
michelkok opened this issue Nov 7, 2023 · 6 comments
Open

How to get coverage per file #236

michelkok opened this issue Nov 7, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@michelkok
Copy link

Please, can you help me find how I can get more detailed information in the report?
image

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.
image

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/CodeCoverageSummary@v1.3.0
        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?

@michelkok michelkok added the enhancement New feature or request label Nov 7, 2023
@github-actions github-actions bot added this to To do in Enhancements Nov 7, 2023
Copy link

github-actions bot commented Feb 6, 2024

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.

@github-actions github-actions bot added the stale label Feb 6, 2024
@michelkok
Copy link
Author

No, don't close, there is clearly more interest than just me without any response.

@github-actions github-actions bot removed the stale label Feb 7, 2024
@jkcdarunday
Copy link

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.

Copy link

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.

@github-actions github-actions bot added the stale label May 14, 2024
@michelkok
Copy link
Author

Again, no, don't close, there is clearly more interest than just me without any response.

@github-actions github-actions bot removed the stale label May 15, 2024
@RosalynLP
Copy link

Yes I'm trying to work out how to do this today please keep open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

4 participants