aspect-build / aspect-build/rules_js

[Bug]: `vitest` on Linux cannot find test files

Open
#979 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted need: funding
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### What happened?

Running `vitest run` on Linux with `rules_js` fails because the `vitest` runner is not able to find any of the test files. The same target works fine under macOS (also note that the macOS run is finding the files twice under different locations ).

The same command `vitest run` also works on both platform through either `yarn` or `pnpm`.

### Version

Development (host) and target OS/architectures:

Output of `bazel --version`:
- `bazel 6.1.1`

Version of the Aspect rules, or other relevant rules from your `WORKSPACE` or `MODULE.bazel` file:
- `v1.23.2`

Language(s) and/or frameworks involved:
- `vite`
- `vitest`

### How to reproduce

A minimal repro can be found on this repo: https://github.com/z8v/vitest-rules_js. It includes all the mentioned test cases on the CI as GitHub actions. The example is mostly based on the `vue` example from https://github.com/aspect-build/bazel-examples with the addition of tests.

An example of such run: https://github.com/z8v/vitest-rules_js/actions/runs/4575634560/jobs/8078707219

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the minimal reproduction linked in the issue and its GitHub Actions CI runs, comparing `vitest run` through the Bazel target on Linux and macOS with the yarn and pnpm cases. The fix is complete when the Linux run discovers the test files and the macOS run no longer reports duplicate locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vite
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.