Skip to content

Parse Jest test results from system-out - #48

Merged
tgodzik merged 1 commit into
VirtusLab:mainfrom
harunaOseni:fix/jest-system-out-test-results-server
May 20, 2026
Merged

Parse Jest test results from system-out#48
tgodzik merged 1 commit into
VirtusLab:mainfrom
harunaOseni:fix/jest-system-out-test-results-server

Conversation

@harunaOseni

Copy link
Copy Markdown

Problem

Some JavaScript/TypeScript test runners can produce Bazel XML with only an aggregate failed testcase while the detailed Jest results are present in system-out. In that case BSP clients receive only the target-level failure and cannot mark individual Jest test cases accurately.

Summary

  • Detect Jest-style output in XML system-out when the normal JUnit testcase data is incomplete.
  • Parse Jest pass/fail/skipped lines into individual BSP test notifications.
  • Keep the fallback XML behavior for non-Jest output.
  • Avoid treating ordinary stdout bullet lines as skipped tests.

Test plan

  • bazel test //server/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/bep:TestXmlParserTest
  • Manual: installed a local snapshot server and verified Jest child statuses are reported from system-out for mixed pass/fail runs.

@tgodzik

tgodzik commented May 19, 2026

Copy link
Copy Markdown
Member

Thanks for contributing! Could you run formatting on the PR? Otherwise looks good.

@harunaOseni
harunaOseni force-pushed the fix/jest-system-out-test-results-server branch from bcfddbf to 7d14440 Compare May 19, 2026 18:56
@harunaOseni

harunaOseni commented May 19, 2026

Copy link
Copy Markdown
Author

Done, thanks.

@tgodzik
tgodzik merged commit c28e025 into VirtusLab:main May 20, 2026
3 of 4 checks passed
mnoah1 pushed a commit to uber/vscode-bazel-bsp that referenced this pull request May 25, 2026
## Problem
Project and source-directory runs for TypeScript Jest targets were
executing the broad Bazel target without narrowing to the selected test
file. A run could therefore fail because of another file or suite in the
same Bazel target, while the selected file or suite had passing tests.
Test Explorer then only had the aggregate target failure to apply and
could show unrelated discovered tests or suite containers as failed.

## Summary
- Keep TypeScript-specific run behavior behind language tools.
- Run TypeScript source-directory selections at source-file granularity.
- Pass the selected TypeScript test file as a BSP test argument so
Bazel/Jest narrows execution to that file.
- Keep non-TypeScript source-directory behavior unchanged.
- Let container/suite nodes inherit child statuses instead of forcing
aggregate target failures onto them.
- Filter TypeScript source discovery to actual Jest test file names.

## Related server change
- Pairs with VirtusLab/bazel-bsp#48 so Jest child statuses can be
reported when Bazel XML only contains an aggregate failed testcase and
detailed Jest output is in `system-out`.

## Test plan
- `yarn test-compile`
- `yarn lint:single src/test-info/test-info.ts
src/test/suite/test-info.test.ts`
- Manual: packaged and installed the extension locally, then verified
file, directory, and suite runs use file-scoped execution and preserve
individual child statuses for mixed pass/fail results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants