bazelbuild / bazelbuild/bazel

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

Open
#27,435 2 comments 0 reactions 0 assignees View on GitHub
coverage team-Core team-Rules-Python type: bug untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

I've already opened an issue in rules_python repository and it seems to me like the conclusion was that I am suppose to open it here instead.
(https://github.com/bazel-contrib/rules_python/issues/3345)

Summary whaen trying to use bazelisk coverage feaute, Iget:
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.

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

### Which category does this issue belong to?

Python Rules, Core

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Run: bazelisk coverage --combined_report=lcov //... --test_output=all

Here's a sneak peak at my configuration files; https://github.com/TeodorMalbasic/bazel_coverage_target_issue

### Which operating system are you running Bazel on?

Ubuntu 24.04 (DOCKER CONTAINER)

### What is the output of `bazel info release`?

release 8.4.2

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text
It returns the URL of the Git repo (http) I'm having in my bazel workspace and also the hash value.
```

### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

not a regression

### Have you found anything relevant by searching the web?

Used Copilot AI.

### Any other information, logs, or outputs that you want to share?

All files reported in the content of the **bazel-out/_coverage/_coverage_report.dat** file have these coverage values:
FNF:0
FNH:0
LH:0
LF:0

Contributor guide

Open the contributing guide

Research direction

Reproduce `bazelisk coverage --combined_report=lcov //... --test_output=all` using the linked configuration and inspect `bazel-out/_coverage/_coverage_report.dat`, along with the GCov warning. Compare the behavior with the rules_python issue and verify that Python unittest-based `py_test` targets produce nonzero LCOV data without the missing-GCov message.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.