bazel-contrib / bazel-contrib/rules_python

bazel coverage produces empty coverage analysis reports and a message about missing GCov when running against a py_test target

オープン
#3,345 コメント 10 件 リアクション 1 件 担当者 0 名 GitHub で見る
need: repro
主要言語
Starlark
スター
688
フォーク
721
平均マージ
15時間 7分
マージ済み PR(30日)
76

説明

# 🐞 bug report

### Affected Rule

The issue is caused by the rule: py_test()

### Is this a regression?

No

### Description

After the successful execution of the bazel test command I attempted to add the coverage tool too.
Unfortunately, I get output:

GCov does not exist at the given path: ''
Oct 13, 2025 12:50:34 PM com.google.devtools.coverageoutputgenerator.Main runWithArgs
WARNING: There was no coverage found.

I want to use the coverage (opensource) pip package for gathering coverage data of Python tests. I have no clue why running
**bazelisk coverage --combined_report=lcov //... --test_output=all** returns that GCov does not exist.

My test scripts are written with unittest framework, and they successfully run with bazelisk test :all --test_output=all

## 🔬 Minimal Reproduction

https://github.com/TeodorMalbasic/bazel_coverage_target_issue.git

## 🔥 Exception or Error


GCov does not exist at the given path: ''
Oct 13, 2025 12:50:34 PM com.google.devtools.coverageoutputgenerator.Main runWithArgs
WARNING: There was no coverage found.

## 🌍 Your Environment

**Operating System:**

  

Ubuntu 24.04

**Output of `bazel version`:**

  

bazel 8.4.2

**Rules_python version:**

  

Python 3.12.3 on machine, Python 3.12.11 in MODULE.bazel

**Anything else relevant?**

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the linked minimal reproduction and run `bazelisk coverage --combined_report=lcov //... --test_output=all`, then compare it with the successful `bazelisk test :all --test_output=all` run. Investigate how coverage is invoked for the `py_test()` target; done means the command produces a nonempty coverage analysis report without the missing-GCov warning.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system, testing
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
28/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。