Skip to content

test(linter/plugins): fix garbled output from assertions#16738

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-11-test_linter_plugins_fix_garbled_output_from_assertions
Dec 11, 2025
Merged

test(linter/plugins): fix garbled output from assertions#16738
graphite-app[bot] merged 1 commit intomainfrom
12-11-test_linter_plugins_fix_garbled_output_from_assertions

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Dec 11, 2025

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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Dec 11, 2025
Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 11, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_COLORS before loading any modules that use the assert module
  • 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.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Dec 11, 2025

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.
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_fix_garbled_output_from_assertions branch from 69f77ec to 4416b34 Compare December 11, 2025 11:17
@graphite-app graphite-app bot merged commit 4416b34 into main Dec 11, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 12-11-test_linter_plugins_fix_garbled_output_from_assertions branch December 11, 2025 11:23
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
graphite-app bot pushed a commit that referenced this pull request Dec 11, 2025
…mance tester (#16756)

Repeat of #16723. `^` diff marker lines still appear and disappear non-deterministically. It seems #16738 didn't fix it after all. Grrr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants