Skip to content

[workflow] only report coverage for changed files #2524

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

Conversation

FrankLeeeee
Copy link
Contributor

@FrankLeeeee FrankLeeeee commented Jan 30, 2023

Issue Number

Fixed #2530 .

What does this PR do?

This PR modified the behavior of the test coverage report in CI. It only reports coverage rate for the changed files in a PR now so that the develop knows whether his/her changes are tested sufficiently. A sample report is given below.

Screenshot 2023-01-30 at 18 05 42

@github-actions
Copy link
Contributor

Your pre-commit check failed, follow the steps to run pre-commit on your file for code style consistency.

  1. install pre-commit via "pip install pre-commit"
  2. install pre-commit hooks via "pre-commit install"
  3. run pre-commit on file with format error via "pre-commit run --files path" by replacing "path" with the actual file path
  4. commit and push to your branch

View your job at https://github.com/hpcaitech/ColossalAI/actions/runs/4039789704.
Read our "CONTRIBUTING.md" for more reference to the code style.

@github-actions
Copy link
Contributor

Your pre-commit check failed, follow the steps to run pre-commit on your file for code style consistency.

  1. install pre-commit via "pip install pre-commit"
  2. install pre-commit hooks via "pre-commit install"
  3. run pre-commit on file with format error via "pre-commit run --files path" by replacing "path" with the actual file path
  4. commit and push to your branch

View your job at https://github.com/hpcaitech/ColossalAI/actions/runs/4039797950.
Read our "CONTRIBUTING.md" for more reference to the code style.

@FrankLeeeee FrankLeeeee force-pushed the hotfix/replace-pytest-cov-with-coverage.py branch from f91ea02 to a036ddd Compare January 30, 2023 02:03
@FrankLeeeee
Copy link
Contributor Author

The code coverage for the changed files is 15%

Click me to view the complete report

Name                                                                                                 Stmts   Miss  Cover
------------------------------------------------------------------------------------------------------------------------
tests/test_auto_parallel/test_tensor_shard/test_shape_consistency_pass.py                               75     75     0%
tests/test_auto_parallel/test_tensor_shard/test_solver_with_resnet_v2.py                                55     55     0%
------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                42886  36429    0%

@FrankLeeeee
Copy link
Contributor Author

The comment above is the sample report provided by this CI. It will only include the report for changed files.

@hpcaitech hpcaitech deleted a comment from github-actions bot Jan 30, 2023
@FrankLeeeee FrankLeeeee merged commit b55deb0 into hpcaitech:main Jan 30, 2023
@FrankLeeeee FrankLeeeee deleted the hotfix/replace-pytest-cov-with-coverage.py branch January 30, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Only report test coverage for changed files
2 participants