diff options
author | Jeremy Bettis <jbettis@google.com> | 2022-07-27 11:12:49 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-28 19:16:00 +0000 |
commit | 59dedd2d93268a2729b994cc3134b9090b683d22 (patch) | |
tree | 510661d733b4aec2ba0a8e1f712503c016d30534 /docs | |
parent | b5afcd2bffae6e3c0f4fd547c6396ed19e8a9576 (diff) | |
download | chrome-ec-59dedd2d93268a2729b994cc3134b9090b683d22.tar.gz |
ec: Add instructions for CQ to code cov doc
Add instructions on how to view code coverage without running the tests
locally.
BRANCH=None
BUG=None
TEST=None
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: I03c82213949aa7916b8c12e6728a9869cd21d184
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3789920
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
Commit-Queue: Yuval Peress <peress@google.com>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/code_coverage.md | 64 | ||||
-rw-r--r-- | docs/images/artifacts.png | bin | 0 -> 52896 bytes | |||
-rw-r--r-- | docs/images/dir_coverage.png | bin | 0 -> 98944 bytes | |||
-rw-r--r-- | docs/images/download_html.png | bin | 0 -> 51538 bytes | |||
-rw-r--r-- | docs/images/file_coverage.png | bin | 0 -> 159927 bytes | |||
-rw-r--r-- | docs/images/gerrit_coverage_links.png | bin | 0 -> 146042 bytes | |||
-rw-r--r-- | docs/images/postsubmit.png | bin | 0 -> 103906 bytes | |||
-rw-r--r-- | docs/images/test_firmware.png | bin | 0 -> 43721 bytes |
8 files changed, 64 insertions, 0 deletions
diff --git a/docs/code_coverage.md b/docs/code_coverage.md index a15c61b358..c5fdd9e0ad 100644 --- a/docs/code_coverage.md +++ b/docs/code_coverage.md @@ -63,3 +63,67 @@ For coverage report for a single test you can run: Example: `zmake test --coverage test-drivers` `genhtml -q -o build/zephyr/test-drivers/output/coverage_rpt/ build/zephyr/test-drivers/output/zephyr.info` + +## Code Coverage in CQ + +There are several ways to see the code coverage without running the tests +locally, depending on what information you want to see. Many of the links +below are only available to Googlers or TVCs with google.com accounts. + +### Code search + +To see the coverage of each directory, visit +http://cs/chromeos_public/src/platform/ec/ and turn on the "Directory Coverage" +layer. The denominator for the percentage covered is not clear, so these +numbers are really only useful if you are looking in very general terms. I.e. +zephyr is covered better than common. Don't get too fixated on the specific +percent shown. The results are also the last 7 days of builds combined, so there +may be some odd results if the code has changed greatly in the last week. + +![Directory coverage screenshot](images/dir_coverage.png) + +The coverage of files is much more useful. If you are about to write a test +and not sure what to focus on, you can look at the uncovered lines in code +search. Visit [a file](http://cs/chromeos_public/src/platform/ec/common/mkbp_event.c) +in code search and make sure the "File Coverage" layer is enabled. Lines that +are not covered by any test are in red, tested lines are in green, and uncolored +lines were not built at all in any board or test. + +![File coverage screenshot](images/file_coverage.png) + +### Presubmit + +Every gerrit cl, if you did a dry-run or full run of the CQ will have coverage +results. They are slightly difficult to get to, but are very useful. + +On the "Checks" tab, find the build "firmware-zephyr-cov-cq" and open it. + +![Gerrit screenshot](images/gerrit_coverage_links.png) + +On the LUCI page, expand the "test firmware" step and click on "response". That +will show you a very basic summary of the coverage. + +![LUCI screenshot test firmware](images/test_firmware.png) + +For a detailed report, you can download the coverage report. Expand "try to +upload artifacts", then "upload artifacts", and click on "gs upload dir". + +![LUCI screenshot artifacts](images/artifacts.png) + +From there, click on the download icon for the html.tbz2 file, and untar it +locally. Open lcov_rpt/index.html to view your results. + +![GCS screenshot](images/download_html.png) + +### Post-submit + +If you are interested in the state of the world, not a specific CL, and the +coverage info in Code Search is not sufficient, you can download the coverage +report from the post-submit CQ build. + +Visit https://ci.chromium.org/p/chromeos/builders/postsubmit/firmware-zephyr-cov-postsubmit +and click on the latest successful build. + +![LUCI post-submit screenshot](images/postsubmit.png) + +From there, it is exactly the same steps as above to get to the artifacts. diff --git a/docs/images/artifacts.png b/docs/images/artifacts.png Binary files differnew file mode 100644 index 0000000000..2981509362 --- /dev/null +++ b/docs/images/artifacts.png diff --git a/docs/images/dir_coverage.png b/docs/images/dir_coverage.png Binary files differnew file mode 100644 index 0000000000..152b2711a2 --- /dev/null +++ b/docs/images/dir_coverage.png diff --git a/docs/images/download_html.png b/docs/images/download_html.png Binary files differnew file mode 100644 index 0000000000..399d098936 --- /dev/null +++ b/docs/images/download_html.png diff --git a/docs/images/file_coverage.png b/docs/images/file_coverage.png Binary files differnew file mode 100644 index 0000000000..f110e44200 --- /dev/null +++ b/docs/images/file_coverage.png diff --git a/docs/images/gerrit_coverage_links.png b/docs/images/gerrit_coverage_links.png Binary files differnew file mode 100644 index 0000000000..43afac943e --- /dev/null +++ b/docs/images/gerrit_coverage_links.png diff --git a/docs/images/postsubmit.png b/docs/images/postsubmit.png Binary files differnew file mode 100644 index 0000000000..65c630276f --- /dev/null +++ b/docs/images/postsubmit.png diff --git a/docs/images/test_firmware.png b/docs/images/test_firmware.png Binary files differnew file mode 100644 index 0000000000..42f707810a --- /dev/null +++ b/docs/images/test_firmware.png |