Skip to content

bug: Coverage Report Shows no valid records found with bootstrap_impl=script #2572

Closed
@ewianda

Description

@ewianda

🐞 bug report

Affected Rule

py_test

Is this a regression?

Yes, bug was introduced in #2409

Description

No coverage report is generated for --@rules_python//python/config_settings:bootstrap_impl=script

🔬 Minimal Reproduction

Steps to reproduce the issue:

  1. Clone the repository:

    git clone git@github.com:bazelbuild/rules_python.git
    cd rules_python/examples/bzlmod
  2. Run the following command to clean and generate a coverage report:

    bazelisk clean && \
    bazelisk coverage //tests:version_default_test --combined_report=lcov \
        --@rules_python//python/config_settings:bootstrap_impl=script \
        --cache_test_results=no --instrument_test_targets && \
    lcov --list bazel-out/_coverage/_coverage_report.dat
  3. Error Observed:

    lcov: ERROR: no valid records found in tracefile bazel-out/_coverage/_coverage_report.dat
    (use "lcov --ignore-errors empty ..." to bypass this error)
  4. Checkout a specific commit regression:

    git checkout 4a55ef4c2363f7ffc1ec9ba511fba7b2547ccefc
    bazelisk clean && \
    bazelisk coverage //tests:version_default_test --combined_report=lcov \
        --@rules_python//python/config_settings:bootstrap_impl=script \
        --cache_test_results=no --instrument_test_targets && \
    lcov --list bazel-out/_coverage/_coverage_report.dat
  5. Output Observed:

                        |Lines       |Functions  |Branches
    Filename            |Rate     Num|Rate    Num|Rate     Num
    ============================================================
    [tests/]
    version_test.py     | 0.0%      5|    -     0|    -      0
    ============================================================
                    Total:| 0.0%      5|    -     0|    -      0
    

🔥 Exception or Error

When running the initial command, the following error is observed:

lcov: ERROR: no valid records found in tracefile bazel-out/_coverage/_coverage_report.dat
(use "lcov --ignore-errors empty ..." to bypass this error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions