Skip to content

Commit 0e47fe7

Browse files
sergeyberezinCommit bot
sergeyberezin
authored and
Commit bot
committed
test.py: compute coverage per top-level module.
This allows specifying minimum expected coverage per python module. BUG=606878 [email protected] Review-Url: https://codereview.chromium.org/1917383002
1 parent aa64dd6 commit 0e47fe7

File tree

30 files changed

+629
-32
lines changed

30 files changed

+629
-32
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/annotation-parser/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chrome_infra_console/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chrome_infra_console_loadtest/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chrome_infra_packages/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chrome_infra_stats/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100

appengine/chromium_bugs/.coveragerc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_bugs/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100

appengine/chromium_build/.coveragerc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_build/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 24
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_build_logs/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_committers/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_cq_status/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_rietveld/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100

appengine/chromium_status/.coveragerc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_status/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/chromium_try_flakes/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100

appengine/cr-buildbucket/.coveragerc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/cr-buildbucket/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100

appengine/cr-buildbucket/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
.coverage*
21
tools/protoc

appengine/cr-buildbucket/service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def search(
325325
_check_search_acls(buckets)
326326
elif retry_of:
327327
retry_of_build = model.Build.get_by_id(retry_of)
328-
if retry_of_build:
328+
if retry_of_build: # pragma: no cover
329329
buckets = [retry_of_build.bucket]
330330
else:
331331
buckets = acl.get_available_buckets()

appengine/cr-doc/.coveragerc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/cr-doc/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100

appengine/cr_rev/.coveragerc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[run]
2+
include = ./appengine/cr_rev/*
3+
4+
[report]
5+
exclude_lines =
6+
# Have to re-enable the standard pragma
7+
pragma: no cover
8+
9+
# Don't complain about missing debug-only code:
10+
def __repr__
11+
if self\.debug
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
# Don't complain if non-runnable code isn't run:
18+
if 0:
19+
if __name__ == ['"]__main__['"]:
20+
21+
[expect_tests]
22+
expected_coverage_min = 100

0 commit comments

Comments
 (0)