-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 |
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? |
@golowanow - friendly ping to please rebase |
Group Twister code coverage command line arguments for better usability. Add more details in descriptions. Signed-off-by: Dmitrii Golovanov <[email protected]>
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]>
5a40034
to
8053dae
Compare
^^ @hakehuang, @nashif, @PerMac |
New Twister option `--coverage-sections` allows to select code coverage reports to compose into an additional JSON file (twister_coverage.json). By default, the new option is disabled. 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 the coverage run status is reported. 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' property with a full path to what binary tool has been used. Depending on `--coverage-split` and `--disable-coverage-aggregation` options the coverage data is attached either to its test suite object or/and as the report's top level object with the aggregated summary of the current test plan execution scope. In case of the custom report name, or per-platform report, the report name is composed with the rightmost '_coverage.json' suffix. The code coverage report has similar structure as `twister.json` and compelements it having reduced set of test suite properties: - instead of `testcases` it contains `coverage` object with gcov tool JSON report data embedded there; - other properites are limited to represent only the essential test suite context, thus to allow further data processing consistently and independently from the `twister.json`. Signed-off-by: Dmitrii Golovanov <[email protected]>
8053dae
to
43b9852
Compare
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.
per test coverage analysis and processing data using the queue is fine. We should not be capturing this data however just because we can, there are tools that process this data and display it already, so lets use those tools.
#84106 shows how this can be done with available analysis and visualization tools.
@nashifl, It is totally not clear what kind of changes you request with your -1 at this PR now. Did you read the preamble or the related RFC ? |
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_coverage.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' property 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