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

Generate standard code coverage report data file in python:test task #74

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Generate standard code coverage report data file in python:test task #74

merged 1 commit into from
Jan 18, 2024

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Jan 18, 2024

The coverage run command used to run the Python unit tests generates a .coverage data file. This file can not be consumed directly by the "codecov/codecov-action" GitHub Actions action that uploads the coverage data to Codecov. A separate coverage xml command must be used to generate the appropriate file.

Previously this coverage xml command was ran directly in the test runner GitHub Actions workflow. However, the file is also required by contributors running tests on their local machines in some cases (e.g., displaying coverage in the VS Code editor via the popular "Coverage Gutters" extension, which does not support the .coverage file). For this reason, it is best to move the coverage xml command invocation to the taskfile. The time required to generate the file is insignificant so it is added to the python:test task rather than adding a separate task the contributor would be required to run after the python:test task.

The `coverage run` command used to run the Python unit tests generates a `.coverage` data file. This file can not be
consumed directly by the "codecov/codecov-action" GitHub Actions action that uploads the coverage data to Codecov. A
separate `coverage xml` command must be used to generate the appropriate file.

Previously this `coverage xml` command was ran directly in the test runner GitHub Actions workflow. However, the file is
also required by contributors running tests on their local machines in some cases (e.g., displaying coverage in the VS
Code editor via the popular "Coverage Gutters" extension, which does not support the `.coverage` file). For this reason,
it is best to move the `coverage xml` command invocation to the taskfile. The time required to generate the file is
insignificant so it is added to the `python:test` task rather than adding a separate task the contributor would be
required to run after the `python:test` task.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Jan 18, 2024
@per1234 per1234 self-assigned this Jan 18, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0d14d3a) 100.00% compared to head (9bd380a) 100.00%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #74   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          729       729           
=========================================
  Hits           729       729           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@per1234 per1234 merged commit c41445b into arduino:main Jan 18, 2024
22 checks passed
@per1234 per1234 deleted the coverage-report-from-task branch January 20, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants