aglinxinyuan opened a new pull request, #7586:
URL: https://github.com/apache/texera/pull/7586
### What changes were proposed in this PR?
The browser-mode suite runs in CI and uploads its JUnit results, but never
its **coverage** — so every line those tests exercise is reported as untested.
This closes that gap. No test is added or changed.
Measured on `code-editor.component.ts` by intersecting the two lcov records:
| | Lines |
|---|---|
| uncovered by the jsdom run (what Codecov reports today) | 115 |
| of those, **already hit** by the browser spec | **67** |
| genuinely untested by either | 48 |
| merged coverage | 181/229 = **79.0%**, up from 49.8% |
So roughly three-fifths of that file's advertised gap is already tested. Any
PR written off the Codecov ranking would have duplicated seven existing tests
to move a number.
**Passing `--coverage` alone does not work.** The run fails with:
```
TypeError: Failed to fetch dynamically imported module:
http://localhost:PORT/@id/@vitest/coverage-v8/browser?import
```
The coverage provider is imported dynamically once `--coverage` is set, so
it is not in the import graph Vite's scan crawls — the same reason `buffer`
already needed an explicit hint in this config. Adding
`@vitest/coverage-v8/browser` to `optimizeDeps.include` fixes it. Note the
failure mode: **the tests still pass while the coverage step errors**, which is
why this went unnoticed.
Three changes:
- `vitest.browser.config.ts` — add the `optimizeDeps` include, and write
coverage to `coverage-browser/` so it cannot overwrite the jsdom run's
`coverage/gui/lcov.info` (that upload happens earlier in the job).
- `build.yml` — pass `--coverage --coverage-reporters=lcovonly` to the
browser step and upload the result under the existing `frontend` flag, which
Codecov merges with the jsdom upload.
- `frontend/.gitignore` — ignore the new output directory.
### How was this PR tested?
Reproduced the failure on `main` first: `ng run gui:test-browser --coverage`
exits 1 with three errors (Prepare / Run / Coverage) and produces no lcov,
while the 7 tests pass.
With the fix, the full browser suite:
```
yarn --cwd frontend ng run gui:test-browser --coverage
--coverage-reporters=lcovonly
```
```
Test Files 3 passed (3)
Tests 18 passed (18)
```
exit 0, no errors, and `coverage-browser/lcov.info` written with 98 files /
1942 lines recorded. The jsdom path is unaffected — `ng test --coverage` still
passes 25 tests and still writes `coverage/gui/lcov.info`. `yarn format:ci`
passes.
### Any related issues, documentation, discussions?
Closes #7462
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]