[Bug]: Coverage report is empty
What happened?
When I run the command bazel coverage --action_env=VERBOSE_COVERAGE=true --combined_report=lcov -- any_test_target, I see empty dat files getting created for the _test.py files and bazel prints out the following log
INFO: From Coverage report generation:
Jan 27, 2025 11:50:39 A.M. com.google.devtools.coverageoutputgenerator.Main getTracefiles
INFO: Found 1 tracefiles.
Jan 27, 2025 11:50:39 A.M. com.google.devtools.coverageoutputgenerator.Main parseFilesSequentially
INFO: Parsing file bazel-out/darwin_arm64-fastbuild/testlogs/projects/libs/examples/calculator/calculator_test/coverage.dat
Jan 27, 2025 11:50:39 A.M. com.google.devtools.coverageoutputgenerator.Main getGcovInfoFiles
INFO: No gcov info file found.
Jan 27, 2025 11:50:39 A.M. com.google.devtools.coverageoutputgenerator.Main getGcovJsonInfoFiles
INFO: No gcov json file found.
Jan 27, 2025 11:50:39 A.M. com.google.devtools.coverageoutputgenerator.Main getProfdataFileOrNull
INFO: No .profdata file found.
Jan 27, 2025 11:50:39 A.M. com.google.devtools.coverageoutputgenerator.Main runWithArgs
WARNING: There was no coverage found.
Target //projects/libs/examples/calculator:calculator_test up-to-date:
bazel-bin/projects/libs/examples/calculator/calculator_test
bazel-bin/projects/libs/examples/calculator/calculator_test.venv.pth
eventually the combined report bazel-out/_coverage/_coverage_report.dat is empty too.
Version
Development (host) and target OS/architectures:
Output of bazel --version: bazel 8.0.0
Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: aspect_rules_py 1.2.1
Language(s) and/or frameworks involved: python
How to reproduce
I made this repro repository to show my issue:
https://github.com/bu3/rules_python_repro/tree/main
at the root of the repo, you can find the script `run_code_coverage.sh` which runs the command I described above and check for the content of the combined report
Any other information?
No response
I noticed this mentioning py_pytest_main so I have added that too to my BUILD file along with the coverage and pytest dependencies.
Still the report results empty
NVM I ran gazelle after adding py_pytest_main to the BUILD file and now the report contains data