--bes_backend flag appears to change behavior of "coverage" command without targets
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
Adding the `--bes_backend` flag to Bazel appears to alter the end status of an invocation running the `coverage` command.
It appears as if the existence of the flag changes the build from successful
`INFO: Build completed successfully, 1 total action`
to an error
`ERROR: No test targets were found, yet testing was requested`
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Run all commands inside `https://github.com/bazelbuild/examples` under the `{root}/java-tutorial/` directory.
An actual BES is not necessary to repro so the timeout is set to a very short period (10ms) and the BES failure is ignored.
1. Run `bazel --nohome_rc --noworkspace_rc coverage --bes_timeout=10ms`
2. Note the end status is `INFO: Build completed successfully, 1 total action`
3. Run `bazel --nohome_rc --noworkspace_rc coverage --bes_backend=grpcs://foo.bar --bes_timeout=10ms`
4. Note the end status is `ERROR: No test targets were found, yet testing was requested`
This error can also be reproduced using the `--build_event_json` flag:
`bazel --nohome_rc --noworkspace_rc coverage`
vs
`bazel --nohome_rc --noworkspace_rc coverage --build_event_json_file=foo.json`
### Which operating system are you running Bazel on?
Ubuntu 20.04.4
### What is the output of `bazel info release`?
release 5.2.0
### 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 master; git rev-parse HEAD` ?
```text
$ git remote get-url origin
https://github.com/bazelbuild/examples
$ git rev-parse main
5a8696429e36090a75eb6fee4ef4e91a3413ef13
$ git rev-parse HEAD
5a8696429e36090a75eb6fee4ef4e91a3413ef13
```
```
### Have you found anything relevant by searching the web?
Found nothing.
### Any other information, logs, or outputs that you want to share?
N/A
Contributor guide
Assessment
This issue has not been assessed yet.