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

Đang mở
#3,345 10 bình luận 1 reaction 0 người được giao Xem trên GitHub
need: repro
Ngôn ngữ chính
Starlark
Star
688
Fork
721
Merge trung bình
15 giờ 7 phút
Pull request đã merge (30 ngày)
76

Mô tả

# 🐞 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?**

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện tối thiểu được liên kết và chạy `bazelisk coverage --combined_report=lcov //... --test_output=all`, sau đó so sánh với lần chạy thành công của `bazelisk test :all --test_output=all`. Điều tra cách coverage được gọi cho target `py_test()`; hoàn tất khi lệnh tạo ra một báo cáo phân tích coverage không rỗng mà không có cảnh báo thiếu GCov.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system, testing
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
28/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.