aspect-build / aspect-build/rules_jest

[Bug]: Coverage is broken for js_test when --experimental_split_coverage_postprocessing is defined

Open
#100 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Starlark
Stars
24
Forks
31
PR merge metrics
No merged PRs in 30d

Description

### What happened?

Hi! I made a copy of the tests in https://github.com/aspect-build/rules_js/tree/main/examples/coverage and tried to run coverage on the tests. Coverage would fail with this error message
```
==================== Test output for //:coverage:
FATAL: the entry_point '/home/christopher.eng/.cache/bazel/_bazel_christopher.eng/3c1075992044037b8e52b66729be4c8b/sandbox/linux-sandbox/3/execroot/temp_name/bazel-out/k8-fastbuild/bin/coverage_test/coverage.sh.runfiles/temp_name/../aspect_rules_js/js/private/coverage/coverage.js' not found in runfiles================================================================================
```
Coverage would run fine when I disabled `--experimental_split_coverage_postprocessing` in my `.bazelrc`

### Version

Development (host) and target OS/architectures: Ubuntu 20.04 x86_64

Output of `bazel --version`:bazel 6.0.0

Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
- aspect_rules_js: 1.15.1
- aspect_bazel_lib: 1.23.3
- aspect_rules_jest: 0.15.0

Language(s) and/or frameworks involved: Javascript

### How to reproduce

```shell
I made a local copy of https://github.com/aspect-build/rules_js/tree/main/examples/coverage and ran

bazel coverage //example:coverage
```

and the error would occur
```

### Any other information?

[Slack thread where I initially raised the issue](https://bazelbuild.slack.com/archives/CEZUUKQ6P/p1675932171242519)

### Fund our work

- [ ] Sponsor our open source work by donating a [bug bounty](https://opencollective.com/aspect-build/)

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `bazel coverage //example:coverage` using the `examples/coverage` copy and compare it with `.bazelrc` when `--experimental_split_coverage_postprocessing` is disabled. Inspect the reported `aspect_rules_js/js/private/coverage/coverage.js` runfiles path and the coverage example; done means coverage succeeds with the flag enabled.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.