Skip to content

[tests] Make test output readable and fix avoidable test run noise - #6237

Merged
vrubezhny merged 1 commit into
redhat-developer:mainfrom
vrubezhny:tests/fix-unreadable-and-noisy-test-output
Oct 30, 2026
Merged

vrubezhny merged 1 commit into
redhat-developer:mainfrom
vrubezhny:tests/fix-unreadable-and-noisy-test-output

Conversation

@vrubezhny

Copy link
Copy Markdown
Contributor
  • Re-color the Mocha 'spec' reporter output for dark terminal themes: passing test titles, failure stack traces and durations are rendered in 'bright black' (ANSI 90), which is nearly invisible on dark themes like VS Code Dark Modern (#3b3b3b on #1f1f1f); they now use the terminal's default foreground color, keeping the colored checkmarks, diffs and summaries
  • Add a shared createMocha() factory (test/mocha-config.ts) combining the options common to all test kinds (spec reporter, tdd ui, colors, palette) with the test-kind specific ones; drop the dead 'require: [./helper.js]' option (CLI-only, and the file does not exist)
  • Stop setting NODE_OPTIONS in build/run-tests.cjs and delete the dead test/bootstrap.ts: VS Code strips NODE_OPTIONS from the extension host environment, so the ESM-to-CJS alias bootstrap never actually loaded there (the extension host, Node.js >= 22.12, natively require()s the ESM-only dependencies); the variable only made the Electron main and renderer processes print "Most NODE_OPTIONs are not supported in packaged apps" errors
  • Disable the GPU of the test VS Code instance: it renders with software rendering anyway, and this prevents "'--ozone-platform=wayland' is not compatible with Vulkan" errors on Wayland sessions
  • Load 'istanbul' and 'remap-istanbul' lazily in test/coverage.ts: loading the test-only istanbul package on every run triggered a Node.js circular-dependency warning; it is now loaded only when coverage data was actually collected
  • Log the 'Installed extensions' debug list from the activation test only when VERBOSE is set

Assisted-By: OpenCode: GLM 5.3

- Re-color the Mocha 'spec' reporter output for dark terminal themes: passing
  test titles, failure stack traces and durations are rendered in 'bright
  black' (ANSI 90), which is nearly invisible on dark themes like VS Code
  Dark Modern (#3b3b3b on #1f1f1f); they now use the terminal's default
  foreground color, keeping the colored checkmarks, diffs and summaries
- Add a shared createMocha() factory (test/mocha-config.ts) combining the
  options common to all test kinds (spec reporter, tdd ui, colors, palette)
  with the test-kind specific ones; drop the dead 'require: [./helper.js]'
  option (CLI-only, and the file does not exist)
- Stop setting NODE_OPTIONS in build/run-tests.cjs and delete the dead
  test/bootstrap.ts: VS Code strips NODE_OPTIONS from the extension host
  environment, so the ESM-to-CJS alias bootstrap never actually loaded there
  (the extension host, Node.js >= 22.12, natively require()s the ESM-only
  dependencies); the variable only made the Electron main and renderer
  processes print "Most NODE_OPTIONs are not supported in packaged apps"
  errors
- Disable the GPU of the test VS Code instance: it renders with software
  rendering anyway, and this prevents "'--ozone-platform=wayland' is not
  compatible with Vulkan" errors on Wayland sessions
- Load 'istanbul' and 'remap-istanbul' lazily in test/coverage.ts: loading
  the test-only istanbul package on every run triggered a Node.js
  circular-dependency warning; it is now loaded only when coverage data was
  actually collected
- Log the 'Installed extensions' debug list from the activation test only
  when VERBOSE is set

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Assisted-By: OpenCode: GLM 5.3
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.71%. Comparing base (d516eb4) to head (cc3ad80).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6237   +/-   ##
=======================================
  Coverage   53.71%   53.71%           
=======================================
  Files         131      131           
  Lines       12007    12007           
  Branches     2699     2718   +19     
=======================================
  Hits         6449     6449           
  Misses       5552     5552           
  Partials        6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vrubezhny
vrubezhny merged commit 9e0b906 into redhat-developer:main Oct 30, 2026
6 checks passed
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.

1 participant