Skip to content

Commit a359bf5

Browse files
authored
Update coverage rc files (#2022)
* Add comments to coverage_system_tests.rc * Add clarity to coverage_unit_tests.rc * further clarify unit tests coverage * reorganize unit test omissions * omit */nidigital/enums.py from unit test coverage I don't believe there's anything special about these enums that we shouldn't just fall back on nifake unit test coverage * Explain */niscope/measurement_stat.py omission * add pb2 omissions * Add grpc_session_options.py omissions * Omit history_ram_cycle_information.py from unit tests * Don't omit session.py from system test coverage * Remove mention of session.py in coverage_system_tests.rc omit list
1 parent 229069d commit a359bf5

File tree

2 files changed

+62
-26
lines changed

2 files changed

+62
-26
lines changed

tools/coverage_system_tests.rc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
; This file controls what modules are examined for code coverage in our system tests.
2+
13
[run]
24
omit =
5+
; Common code, so covered by nifake unit tests.
6+
; Some modules don't even exercise all of _attributes.py and _converters.py, making parts unreachable in system tests.
37
*/__init__.py
48
*/_attributes.py
59
*/_converters.py
10+
*/errors.py
611
*/_library_singleton.py
712
*/_visatype.py
13+
14+
; Although the enum names and values vary between modules, all enums are mostly the same. nifake unit tests cover the various kinds that we use.
815
*/enums.py
9-
*/errors.py
10-
*/session.py
1116

17+
; Most of the lines in *_pb2.py are only used for the pure-Python implementation of protobuf, and the default implementation nowadays is the upb C implementation.
18+
*/*pb2.py
19+
20+
; *_pb2_grpc.py defines a stub, a servicer, and an "experimental API", and we only use the stub.
21+
; If our system test coverage of the stub_interpreter is okay, we should be in good shape.
22+
*/*_pb2_grpc.py
1223

tools/coverage_unit_tests.rc

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,60 @@
1+
; This file controls what modules are examined for code coverage in our unit tests.
2+
; See https://coverage.readthedocs.io/en/latest/source.html#source
3+
14
[run]
5+
; Fileset is restricted to include matches, first
6+
; Unfortunately, all of these patterns will be ignored, because we pass --source, when running the unit tests.
7+
include =
8+
; nifake is tested entirely by unit tests. Its sole purpose is to test code that is common to all APIs
9+
*/nifake/*
10+
; System testing is preferred, but some published modules have code that's easier to test with a unit test
11+
*/nidcpower/lcr_load_compensation_spot.py
12+
*/nidcpower/lcr_measurement.py
13+
*/nidigital/session.py
14+
*/nimodinst/session.py
15+
*/niscope/waveform_info.py
16+
*/nitclk/session.py
17+
build/*
18+
; Any include matches that match omit patterns are removed
219
omit =
20+
; Covered by system tests
321
*/_library*
22+
23+
; Everthing below here needs to be explicitly excluded because "include" is ignored.
24+
25+
; All private modules are covered by nifake unit tests, except for interpreter modules, which are covered by system tests.
426
*/nidcpower/_*
27+
*/nidigital/_*
28+
*/nimodinst/_*
29+
*/niscope/_*
30+
*/nitclk/_*
31+
32+
; Common code, so covered by nifake unit tests
533
*/nidcpower/enums.py
634
*/nidcpower/errors.py
7-
*/nidcpower/session.py
8-
*/nidigital/__init__.py
9-
*/nidigital/_attributes.py
10-
*/nidigital/_converters.py
11-
*/nidigital/_visatype.py
35+
*/nidigital/enums.py
1236
*/nidigital/errors.py
13-
*/nimodinst/__init__.py
14-
*/nimodinst/_converters.py
15-
*/nimodinst/_visatype.py
1637
*/nimodinst/errors.py
17-
*/niscope/_*
1838
*/niscope/enums.py
1939
*/niscope/errors.py
20-
*/niscope/measurement_stats.py
21-
*/niscope/session.py
22-
*/nitclk/__init__.py
23-
*/nitclk/_attributes.py
24-
*/nitclk/_converters.py
25-
*/nitclk/_visatype.py
2640
*/nitclk/errors.py
27-
include =
28-
*/nifake/*
29-
*/nidcpower/lcr_load_compensation_spot.py
30-
*/nidcpower/lcr_measurement.py
31-
*/nidigital/session.py
32-
*/nimodinst/session.py
33-
*/niscope/waveform_info.py
34-
*/nitclk/session.py
35-
build/*
41+
42+
; See the include section; these modules don't have unit tests covering session.py
43+
*/nidcpower/session.py
44+
*/niscope/session.py
45+
46+
; Covered by System tests
47+
*/nidigital/history_ram_cycle_information.py
48+
*/niscope/measurement_stats.py
49+
50+
; Most of the lines in *_pb2.py are only used for the pure-Python implementation of protobuf, and the default implementation nowadays is the upb C implementation.
51+
*/*pb2.py
52+
53+
; *_pb2_grpc.py defines a stub, a servicer, and an "experimental API", and we only use the stub.
54+
; If our system test coverage of the stub_interpreter is okay, we should be in good shape.
55+
*/*_pb2_grpc.py
56+
57+
; grpc_session_options.py is tested by system tests and nifake unit tests
58+
*/nidcpower/grpc_session_options.py
59+
*/nidigital/grpc_session_options.py
60+
*/niscope/grpc_session_options.py

0 commit comments

Comments
 (0)