[blinkpy] Measure unit test coverage
This change configures `run_blinkpy_tests.py` to measure the coverage of
meaningful files with Coverage.py. Coverage measurement is enabled for
the `blink_python_tests` script test target run on builders, but not for
`run_blinkpy_tests.py` itself when run locally by developers.
This change also upgrades some python2-style print statements so that
so that Coverage.py does not crash when importing those modules in
python3.
Change-Id: If452d8e10e3d8d157caa0cd5549f28ac82de1305
Bug: 1344709
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3759441
Commit-Queue: Jonathan Lee <[email protected]>
Reviewed-by: Weizhong Xia <[email protected]>
Reviewed-by: Thomas Anderson <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1026481}
diff --git a/BUILD.gn b/BUILD.gn
index a3cf0a49..4efccb33 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1573,9 +1573,12 @@
script_test("blink_python_tests") {
script = "//testing/scripts/run_isolated_script_test.py"
- args = [ "@WrappedPath(" +
- rebase_path("//third_party/blink/tools/run_blinkpy_tests.py",
- root_build_dir) + ")" ]
+ args = [
+ "@WrappedPath(" +
+ rebase_path("//third_party/blink/tools/run_blinkpy_tests.py",
+ root_build_dir) + ")",
+ "--coverage",
+ ]
data = [
# These tests use //build/android/devil_chromium.py even when !is_android,