CodeCoverageSummary icon indicating copy to clipboard operation
CodeCoverageSummary copied to clipboard

Bug: Duplicate entries in output summary

Open ghorsey opened this issue 11 months ago • 8 comments

Bug Report

My build produces 7 cobertura files for 7 packages. However the summaries show duplicated packages that should only appear once.

Workflow File

jobs:
  build-and-deploy-dev-func:
    runs-on: ubuntu-latest
    steps:      
# Steps before removed
      - name: 'Test Project'
        run: 'dotnet test --configuration ${{ env.AZURE_FUNCTIONAPP_CONFIGURATION }}  --no-build --no-restore --collect:"XPlat Code Coverage" --results-directory ./coverage'

      - name: 'Report Test Coverage'
        uses: 'irongut/[email protected]'
        with:
          filename: app-backend/coverage/**/coverage.cobertura.xml
          badge: true
          fail_below_min: false
          format: markdown
          indicators: true
          output: true # both, console or file
          thresholds: '60 80'

      - name: Add Coverage to Action Summary
        run: cat ${{ github.workspace }}/code-coverage-results.md >> $GITHUB_STEP_SUMMARY
  
      - name: Add Coverage PR Comment
        uses: marocchino/sticky-pull-request-comment@v2
        if: github.event_name == 'pull_request'
        with:
          recreate: true
          path: ${{ github.workspace }}/code-coverage-results.md
# Steps after removed

Actions Log

Run irongut/[email protected]
  with:
    filename: app-backend/coverage/**/coverage.cobertura.xml
    badge: true
    fail_below_min: false
    format: markdown
    indicators: true
    output: both
    thresholds: 60 80
    hide_branch_rate: false
    hide_complexity: false
  env:
    AZURE_FUNCTIONAPP_DEV_NAME: fn-app-dev-zyg6u3bu[2](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:2)ppq2
    AZURE_FUNCTIONAPP_SOURCE_PATH: /home/runner/work/app/app/app-backend/src/apps/C[3](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:3).NanoNotes.Apps.CoreFunc
    AZURE_FUNCTIONAPP_PACKAGE_PATH: /home/runner/work/app/app/app-backend/dist/apps/CoreFunc/net9.0
    AZURE_FUNCTIONAPP_CONFIGURATION: Release
    DOTNET_VERSION: 9.0.x
    HUSKY: 0
    DOTNET_ROOT: /usr/share/dotnet
/usr/bin/docker run --name ghcrioirongutcodecoveragesummaryv130_a813f2 --label 61a89e --workdir /github/workspace --rm -e "AZURE_FUNCTIONAPP_DEV_NAME" -e "AZURE_FUNCTIONAPP_SOURCE_PATH" -e "AZURE_FUNCTIONAPP_PACKAGE_PATH" -e "AZURE_FUNCTIONAPP_CONFIGURATION" -e "DOTNET_VERSION" -e "HUSKY" -e "DOTNET_ROOT" -e "INPUT_FILENAME" -e "INPUT_BADGE" -e "INPUT_FAIL_BELOW_MIN" -e "INPUT_FORMAT" -e "INPUT_INDICATORS" -e "INPUT_OUTPUT" -e "INPUT_THRESHOLDS" -e "INPUT_HIDE_BRANCH_RATE" -e "INPUT_HIDE_COMPLEXITY" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "G
Coverage File: /github/workspace/app-backend/coverage/39eeb511-79cb-[4](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:4)03e-a5e8-f35dccb6c46c/coverage.cobertura.xml
Coverage File: /github/workspace/app-backend/coverage/[5](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:5)47728bc-70de-4a97-a172-dbf794eff[6](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:6)08/coverage.cobertura.xml
Coverage File: /github/workspace/app-backend/coverage/a540413f-0f8b-40ec-8628-[7](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:7)97c68925e4f/coverage.cobertura.xml
Coverage File: /github/workspace/app-backend/coverage/77c346e0-[8](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:8)054-41a2-8d69-8dbef12e5d[9](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:9)0/coverage.cobertura.xml
Coverage File: /github/workspace/app-backend/coverage/e8053566-8966-475d-bfc7-0e23b37[10](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:10)5ba/coverage.cobertura.xml
Coverage File: /github/workspace/app-backend/coverage/e233f30e-4c94-4f99-90f6-8845cc3e08f5/coverage.cobertura.xml
Coverage File: /github/workspace/app-backend/coverage/094bb839-9d00-424a-9178-0e73a[12](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:12)567c3/coverage.cobertura.xml
![Code Coverage](https://img.shields.io/badge/Code%20Coverage-54%25-critical?style=flat)
Package | Line Rate | Branch Rate | Complexity | Health
-------- | --------- | ----------- | ---------- | ------
C3.NanoNotes.Apps.CoreFunc | 0% | 0% | 55 | ❌
C3.Blocks.Domain | 0% | 0% | 36 | ❌
C3.NanoNotes.Libs.Domain | 0% | 0% | 41 | ❌
C3.Blocks.Repository.Testing.Sqlite | 0% | 0% | 6 | ❌
C3.Blocks.Domain | 15% | 4% | 35 | ❌
C3.NanoNotes.Libs.Domain | 100% | 100% | 41 | ✔
C3.Blocks.Repository.Abstractions | 100% | 100% | 0 | ✔
C3.Blocks.Repository.MsSql | 0% | 0% | [14](https://github.com/code-correct-collective/app/actions/runs/12937621059/job/36085933816#step:11:14)0 | ❌
C3.Blocks.Domain | 0% | 0% | 35 | ❌
C3.Blocks.Domain | 100% | 67% | 35 | ✔
C3.Blocks.InProcBus | 99% | 67% | 45 | ✔
C3.NanoNotes.Libs.Repository | 100% | 100% | 0 | ✔
**Summary** | **54%** (180 / 818) | **37%** (29 / 270) | **469** | ❌

Expected Behavior

I would expect that since there are only 7 packages/assemblies in the project, the summary would only contain those unique items. Currently the duplicated assemblies are:

  • C3.Blocks.Domain x4
  • C3.NanoNotes.Libs.Domain x2

Additional Context

Some of the test assemblies are empty because I haven't gotten to write the tests yet. I've just setup the relationship to create the classes and corresponding tests. The following test assemblies are empty (0 tests):

  • C3.Blocks.Repository.MsSql.Tests
  • C3.Blocks.Repository.Testing.Sqlite.Tests
  • C3.NanoNotes.Libs.Repository.Tests
  • C3.NanoNotes.Apps.CoreFunc.Tests

Linked To

List any issues linked to this bug.

ghorsey avatar Jan 23 '25 20:01 ghorsey

If it helps, I see the same thing. I modified the filename glob to only go down a single level. ex. app-backend/coverage/**/coverage.cobertura.xml becomes app-backend/coverage/*/coverage.cobertura.xml

I noticed when I use the XPlat Code Coverage Collector, it is creating a temporary folder in my results folder which had the cobertura.xml file down a few layers. The first Glob picks up the temporary folder.

rmcaneny-cs avatar Jan 27 '25 18:01 rmcaneny-cs

I am experiencing the same issue, but i am already using the single '*' quote in my pipeline longer time.

FAMEEXE avatar Jan 28 '25 07:01 FAMEEXE

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[bot] avatar Apr 29 '25 02:04 github-actions[bot]

NO CLOSING.

pboling avatar May 18 '25 22:05 pboling

Hi, i am working on windows runner, how can i use this action?

rrosh9470 avatar Aug 08 '25 23:08 rrosh9470

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[bot] avatar Nov 07 '25 02:11 github-actions[bot]

BAD STALE BOT.

pboling avatar Nov 07 '25 02:11 pboling

Having the same issue. Got two test projects testing the same two assemblies:

Image

MarcusJacobsson avatar Dec 12 '25 22:12 MarcusJacobsson