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

Avocado Coverage.py updates #5944

Merged
merged 4 commits into from
Jun 10, 2024

Conversation

richtja
Copy link
Contributor

@richtja richtja commented May 30, 2024

This PR does some simplification of caverage.py usage with avocado. And fixes avocado issue related to this topic:

  1. It simplifies the way how coverage.py is used with avocado-instrumented tests Avocado Coverage.py behaviour doesn't correspond to documentation #5919
  2. Adds coverage.py support for python unittests Add support for native code coverage when running Python tests #4957
  3. Use ./selftests/check.py entry point for running avocado coverage job in CI Evaluate the need for selftests/run #4992

This commit simplifies the usage of coverage.py without change of its
behaviour. With these changes, it will be easier for users to set up
avocado for gathering test coverage data.

Reference: avocado-framework#5919
Signed-off-by: Jan Richter <[email protected]>
This commit brings coverage.py feature to python unittest runner. After
this change, you can run coverage.py with avocado for
avocado-instrumented and python unittest types.

Reference: avocado-framework#4957
Signed-off-by: Jan Richter <[email protected]>
@richtja richtja marked this pull request as ready for review May 31, 2024 13:57
The avocado was using `selftests/run` script for running coverage tests.
This script uses python unittests module instead of avocado, which has
few disadvantages. The main is that running the `selftests/run` differs
from running `check.py`, therefore the coverage report hasn't
represented the actual state.

After the latest changes in ea0e23d  and 4100cc2 it is possible to run
avocado's main selftests entry point `check.py` with the coverage.py.
With such change, the running coverage diagnose will use the same
process as our selftests, therefore the report will be more precise.

Reference: avocado-framework#4992
Signed-off-by: Jan Richter <[email protected]>
After the changes in bf58ffc the only used selftests entry point is
`check.py`, therefore we can remove the `selftests/run` script from
avocado repo.

Reference: avocado-framework#4992
Signed-off-by: Jan Richter <[email protected]>
Copy link
Contributor

@harvey0100 harvey0100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@clebergnu clebergnu merged commit cea7a22 into avocado-framework:master Jun 10, 2024
57 checks passed
@arif-ali
Copy link

How would you feel about back porting this to the LTS? We would appreciate it, and we can go fully avocado

@richtja
Copy link
Contributor Author

richtja commented Jun 11, 2024

How would you feel about back porting this to the LTS? We would appreciate it, and we can go fully avocado

Hi @arif-ali this was created based on your comments in #5610 (comment), can you please try it out in your environment? If it works, I don't see a problem with the backport to LTS.

@richtja richtja mentioned this pull request Jun 18, 2024
@richtja richtja deleted the coverage_python branch October 9, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
4 participants