Skip to content

Coverage Report for Changed Files in Pull Requests not correct #127

@Prashant-Kamboj

Description

@Prashant-Kamboj

Issue details
When we create a PR, the coverage workflow runs and compares the coverage against the report generated from the last merge into the main branch. However, I’ve noticed that the coverage report for my PR includes files that I haven’t modified, yet they still appear in the list of changed files in the coverage report.
We are currently using sharding in our tests and then combining the test reports using nyc. Additionally, our repository is private.
action config

  - name: Generate Coverage Report
        uses: clearlyip/code-coverage-report-action@v5
        id: code_coverage_report_action
        with:
          filename: 'combined-coverage/cobertura-coverage.xml'
          github_token: ****
          fail_on_negative_difference: false
          only_list_changed_files: true
          artifact_download_workflow_names: 'Run tests'
          overall_coverage_fail_threshold: '78'
          badge: true

Could this issue be related to artifact retention settings?
Additionally, what steps can we take to ensure that the coverage report accurately reflects only the files changed in the PR? Any suggestions or best practices to achieve this would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions