test(linter/plugins): fix garbled output from assertions#16738
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR fixes non-deterministic output from NodeJS's assert module in the conformance tester by properly setting environment variables before any modules are loaded. The fix involves refactoring the entry point to use dynamic imports, changing from FORCE_COLOR = "0" to NODE_DISABLE_COLORS = "1", and re-enabling the display of diff marker lines (^) in assertion error output.
Key Changes
- Refactored code initialization to set
NODE_DISABLE_COLORSbefore loading any modules that use theassertmodule - Split main logic into a separate file (
main.ts) that is dynamically imported after environment setup - Removed code that was filtering out the
^diff marker lines, as they now appear consistently - Updated snapshot file with consistent
^marker lines in assertion output
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/oxlint/conformance/src/index.ts | Simplified to set NODE_DISABLE_COLORS environment variable and dynamically import main logic, ensuring proper module initialization order |
| apps/oxlint/conformance/src/main.ts | New file containing the main conformance testing logic that was previously in index.ts |
| apps/oxlint/conformance/src/report.ts | Removed code that was filtering out non-deterministic ^ diff marker lines from assertion errors |
| apps/oxlint/conformance/snapshot.md | Updated with consistent ^ diff marker lines that now appear reliably in assertion error output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Conformance tester has been suffering from non-deterministic output from NodeJS's `assert` module. Fix this by setting `process.env.FORCE_COLOR` before loading any code. This also allows leaving the ` ^` diff marker lines in output which were removed in #16723, as they should now appear consistently.
69f77ec to
4416b34
Compare

Conformance tester has been suffering from non-deterministic output from NodeJS's
assertmodule. Fix this by settingprocess.env.FORCE_COLORbefore loading any code.This also allows leaving the
^diff marker lines in output which were removed in #16723, as they should now appear consistently.