refined-addition-53644
01/22/2023, 12:02 PMcov-report
output generated by pytest --cov
? I don’t understand what’s the point of then even running pytest --cov
?
https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/python/goals/pytest_runner.py#L359
I think this is the reason behind this issueenough-analyst-54434
01/22/2023, 12:15 PMrefined-addition-53644
01/22/2023, 1:59 PM.coverage
being generated by pytest-cov
. Otherwise I had the fuller picture.
Now what I am confused about is where this is breaking when using the filter option.
What I tried was to replace the source roots with what I pass in filter directly and this shows the coverage of files without any tests also.
--- a/src/python/pants/backend/python/goals/coverage_py.py
+++ b/src/python/pants/backend/python/goals/coverage_py.py
@@ -411,7 +411,7 @@ async def merge_coverage_data(
"coverage": {
"run": {
"relative_files": True,
- "source": [source_root.path for source_root in source_roots],
+ "source": [path for path in coverage.filter],
"branch": branch,
}
}
enough-analyst-54434
01/22/2023, 2:29 PM>=6.5,<6.6
. Given the major version bump alone, but also glancing at the coverage change log (https://coverage.readthedocs.io/en/7.0.5/changes.html), problems should generally be expected. Pants relies on some coverage APIs to interoperate and the major version bump to 7 allows for APIs to be broken per semver. So 2 questions:
1. What forces you to use coverage 7?
2. Have you tried using Pants default coverage / does it lead to this same issue?refined-addition-53644
01/22/2023, 2:38 PMsource
./pants_from_sources test ::
15:37:11.91 [WARN] DEPRECATED: The autoflake plugin has moved to `pants.backend.python.lint.autoflake` (and from the `fmt` goal to the `fix` goal).
15:37:21.24 [INFO] Completed: Run Pytest - src/package-b/tests/test_package_b.py - succeeded.
15:37:21.24 [INFO] Completed: Run Pytest - src/package-a/tests/test_package_a.py - succeeded.
✓ src/package-a/tests/test_package_a.py succeeded in 1.26s (cached locally).
✓ src/package-b/tests/test_package_b.py succeeded in 1.31s (cached locally).
Name Stmts Miss Cover
-----------------------------------------------------------
src/package-a/package_a/__init__.py 1 0 100%
src/package-a/package_a/main.py 16 16 0%
src/package-a/package_a/package_a.py 5 5 0%
src/package-a/package_a/settings.py 2 2 0%
src/package-a/tests/__init__.py 0 0 100%
src/package-a/tests/fake/__init__.py 0 0 100%
src/package-a/tests/fake/resource.py 1 0 100%
src/package-a/tests/test_package_a.py 8 0 100%
-----------------------------------------------------------
TOTAL 33 23 30%
enough-analyst-54434
01/22/2023, 2:44 PMrefined-addition-53644
01/22/2023, 2:45 PMenough-analyst-54434
01/22/2023, 2:46 PMrefined-addition-53644
01/22/2023, 2:46 PMrules
enough-analyst-54434
01/22/2023, 2:46 PM