-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
twister: coverage: Data collection and reporting per-test instance #66345
base: main
Are you sure you want to change the base?
twister: coverage: Data collection and reporting per-test instance #66345
Conversation
for example, with twister.json
|
@gchwier, @gopiotr, @hakehuang, @nashif, @PerMac up to your attention |
38e4b5f
to
35a1bbe
Compare
rebased to resolve conflicts with #66406 |
@golowanow , maybe change the PR title to enable json report with coverage for each file? |
That title will be misleading as gcovr coverage report already has details for each file, and now it is included into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with some code suggestion on group coverage options. beside the conflict need to be resolved
35a1bbe
to
cffe993
Compare
rebased to resolve conflicts with #66487 and with some minor improvements:
|
cffe993
to
ab3047d
Compare
rebased resolving merge conflict with #66898 |
ab3047d
to
3055b2a
Compare
rebased resolving merge conflict with #66905 |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
@nordic-piks Maybe you'd like to have a look at this? |
Group Twister code coverage command line arguments for better usability. Add more details in descriptions. Signed-off-by: Dmitrii Golovanov <[email protected]>
3055b2a
to
7fe17c5
Compare
rebased to resolve merge conflicts (with #67129), some minor corrections and adjustments to twister tests. @hakehuang, please refresh your +1 |
The new `--coverage-split` mode extends Twister code coverage operations to report coverage statistics on each test instance execution individually in addition to the default reporting mode which aggregates data to one report with all the test instances in the current scope of the Twister run. The split mode allows to identify precisely what amount of code coverage each test case provides and to analyze its contribution to the overall test plan's coverage. Each build directory will have its own coverage report and data files, so the overall disk space and the total execution time increase. The split mode reads the raw data fies while the tests are running in parallel, so the report aggregation stage doesn't need to do the same at its turn. Another new `--disable-coverage-aggregation` option allows to execute only the `--coverage-split` mode if the summary statistics are not needed. Signed-off-by: Dmitrii Golovanov <[email protected]>
New Twister option `--coverage-sections` allow to select what coverage data to include into the `twister.json` file for its further analysis in addition to the test meta-data and the test results. The choices are to select either the coverage summary, or the detailed branch coverage, ztest coverage, or all the coverage data collected. Also the coverage run 'status' and coverage 'tool' values are added with any non-default choice. The 'environment' top object has additional 'gcov_tool' proverty to keep the command line argument selection. Depending on `--coverage-split` and `--disable-coverage-aggregation` options the coverage data is attached either to its test suite object or/and at the report's top level as the aggregated summary of the test plan execution scope. Currently this mode is fully supported for the default gcovr reporting tool only, as it is based on the GCOVR json reports. For lcov only coverage run status is reported. Signed-off-by: Dmitrii Golovanov <[email protected]>
7fe17c5
to
440570f
Compare
@katgiadla, did you have time to check ? |
No, I hadn't. I'll check it at this week. |
@katgiadla, do you have any feedback to share ? |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This needs rebasing but not sure what's the current status of this PR? |
Twister code coverage data collection and reporting improvements:
The new
--coverage-split
mode extend Twister code coverage operations to collect and report statistics on each test instance execution individually in addition to the default reporting mode of data aggregation for all the test instances in current scope of the Twister run.The split mode allows to identify precisely what amount of code coverage each test case provides and to analyze its contribution to the overall test plan's coverage. Each build directory will have its own coverage report and data files, so the overall disk space and the total execution time increase.
The split mode reads the data files while the tests are running in parallel, so the report aggregation stage doesn't need to repeat the same at its turn.
Another new
--disable-coverage-aggregation
option allows to execute only the--coverage-split
mode if the summary statistics are not needed.New Twister option
--coverage-sections
allows to select what coverage data to include into thetwister.json
file for its further analysis together with the test meta-data and test results.The choices are to select either the coverage summary, or the detailed branch coverage, ztest coverage, or all the coverage data collected. Also the coverage run 'status' and coverage 'tool' values are added with any non-default choice. The 'environment' top object has additional 'gcov_tool' proverty to keep the command line argument selection.
Depending on
--coverage-split
and--disable-coverage-aggregation
options, the coverage data is attached either to its test suite object or/and at the report's top level as the aggregated summary of the test plan execution scope.Currently this mode is fully supported for the default gcovr reporting tool only, as it is based on the GCOVR json reports. For lcov only coverage run status is reported.
All the new modes are disabled by default for compatibility.
Resolves #67058