summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-07-27 11:12:49 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-28 19:16:00 +0000
commit59dedd2d93268a2729b994cc3134b9090b683d22 (patch)
tree510661d733b4aec2ba0a8e1f712503c016d30534 /docs
parentb5afcd2bffae6e3c0f4fd547c6396ed19e8a9576 (diff)
downloadchrome-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.md64
-rw-r--r--docs/images/artifacts.pngbin0 -> 52896 bytes
-rw-r--r--docs/images/dir_coverage.pngbin0 -> 98944 bytes
-rw-r--r--docs/images/download_html.pngbin0 -> 51538 bytes
-rw-r--r--docs/images/file_coverage.pngbin0 -> 159927 bytes
-rw-r--r--docs/images/gerrit_coverage_links.pngbin0 -> 146042 bytes
-rw-r--r--docs/images/postsubmit.pngbin0 -> 103906 bytes
-rw-r--r--docs/images/test_firmware.pngbin0 -> 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
new file mode 100644
index 0000000000..2981509362
--- /dev/null
+++ b/docs/images/artifacts.png
Binary files differ
diff --git a/docs/images/dir_coverage.png b/docs/images/dir_coverage.png
new file mode 100644
index 0000000000..152b2711a2
--- /dev/null
+++ b/docs/images/dir_coverage.png
Binary files differ
diff --git a/docs/images/download_html.png b/docs/images/download_html.png
new file mode 100644
index 0000000000..399d098936
--- /dev/null
+++ b/docs/images/download_html.png
Binary files differ
diff --git a/docs/images/file_coverage.png b/docs/images/file_coverage.png
new file mode 100644
index 0000000000..f110e44200
--- /dev/null
+++ b/docs/images/file_coverage.png
Binary files differ
diff --git a/docs/images/gerrit_coverage_links.png b/docs/images/gerrit_coverage_links.png
new file mode 100644
index 0000000000..43afac943e
--- /dev/null
+++ b/docs/images/gerrit_coverage_links.png
Binary files differ
diff --git a/docs/images/postsubmit.png b/docs/images/postsubmit.png
new file mode 100644
index 0000000000..65c630276f
--- /dev/null
+++ b/docs/images/postsubmit.png
Binary files differ
diff --git a/docs/images/test_firmware.png b/docs/images/test_firmware.png
new file mode 100644
index 0000000000..42f707810a
--- /dev/null
+++ b/docs/images/test_firmware.png
Binary files differ