many-agent-62725
03/16/2021, 2:20 PMpython_tests
has the property `coverage`:
coverage: A list of the module(s) you expect for this test target to cover. Usually, Pants and pytest-cov can auto-discover this if your tests are located in the same folder as the python_library code, but this is useful if the tests are not collocated.
However, in version 2.X, I noticed there’s no such property. What’s the equivalent one in Pants 2.X?hundreds-father-404
03/16/2021, 3:47 PMmany-agent-62725
03/16/2021, 3:50 PM--coverage-py-filter
, correct?many-agent-62725
03/16/2021, 3:50 PMpython_test
targetmany-agent-62725
03/16/2021, 3:51 PM--coverage-py-filter
applies to all targets, right?hundreds-father-404
03/16/2021, 3:52 PMmany-agent-62725
03/16/2021, 3:54 PMmany-agent-62725
03/16/2021, 3:56 PMcommon
stack). As of now, when we test the coverage of a particular stack (let’s say stackA
), the common
stack is considered as well. However, we just want to assert the coverage limit for stackA
hundreds-father-404
03/16/2021, 3:56 PMhundreds-father-404
03/16/2021, 3:57 PMmany-agent-62725
03/16/2021, 3:58 PMpants
for each of the stacks, with a different value for --coverage-py-filter
, right?hundreds-father-404
03/16/2021, 3:59 PMhundreds-father-404
03/16/2021, 4:00 PMmany-agent-62725
03/16/2021, 4:04 PMmany-agent-62725
03/16/2021, 4:04 PMhundreds-father-404
03/16/2021, 4:06 PMcoverage combine
to merge all the distinct test results into one single report. So, if you're running all your tests, it may be useful to still include common
The results would be misleading when you do a run locally on a subset of your tests, but that's probably fine - only care about the number in CI that runs over everythingmany-agent-62725
03/16/2021, 4:48 PMcoverage
in python_test
, as this allowed us to apply the coverage threshold per stack. I was hoping the behaviour would stay the same, however, you raised the concern that the coverage could not be correct. I will try the coverage-py-filter
option.