Skip to content

test(linter/plugins): remove non-deterministic error output in conformance tester#16723

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

test(linter/plugins): remove non-deterministic error output in conformance tester#16723
graphite-app[bot] merged 1 commit intomainfrom
12-10-test_linter_plugins_remove_non-deterministic_error_output_in_conformance_tester

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Dec 11, 2025

Report snapshot for conformance test results contains the errors thrown during linting. In the case of AssertionErrors generated by assert, they sometimes contain diff markers e.g.:

+ 'missingClosingLinebreak'
- 'missingOpeningLinebreak'
          ^

However, these ^ only appear sometimes, and seem to do so non-deterministically. They appear and disappear randomly from run to run in some places. Looks like this is a bug in NodeJS.

Remove all such lines from the report to avoid meaningless churn in the snapshot.

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.

@overlookmotel overlookmotel marked this pull request as ready for review December 11, 2025 02:15
Copilot AI review requested due to automatic review settings December 11, 2025 02:15
@overlookmotel overlookmotel self-assigned this Dec 11, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 11, 2025

Merge activity

…mance tester (#16723)

Report snapshot for conformance test results contains the errors thrown during linting. In the case of `AssertionError`s generated by `assert`, they sometimes contain diff markers e.g.:

```
+ 'missingClosingLinebreak'
- 'missingOpeningLinebreak'
          ^
```

However, these `^` only appear sometimes, and seem to do so non-deterministically. They appear and disappear randomly from run to run in some places. Looks like this is a bug in NodeJS.

Remove all such lines from the report to avoid meaningless churn in the snapshot.
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 addresses non-deterministic test output in the conformance tester by removing caret (^) markers that appear randomly in AssertionError diffs. These markers are generated inconsistently by Node.js's assert module, causing unnecessary snapshot churn.

Key Changes:

  • Added logic to filter out diff marker lines containing only ^ in error formatting
  • Updated the conformance test snapshot to reflect the removal of these markers

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/oxlint/conformance/src/report.ts Added a conditional check to skip lines that contain only ^ (after trimming whitespace) when formatting error output
apps/oxlint/conformance/snapshot.md Updated snapshot to remove all instances of non-deterministic ^ diff markers from AssertionError outputs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app graphite-app bot force-pushed the 12-11-refactor_linter_plugins_reduce_code_nesting branch from f509ef4 to 4d9e981 Compare December 11, 2025 02:18
@graphite-app graphite-app bot force-pushed the 12-10-test_linter_plugins_remove_non-deterministic_error_output_in_conformance_tester branch from 4beef87 to ef1ef18 Compare December 11, 2025 02:19
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Base automatically changed from 12-11-refactor_linter_plugins_reduce_code_nesting to main December 11, 2025 02:25
@graphite-app graphite-app bot merged commit ef1ef18 into main Dec 11, 2025
19 checks passed
@graphite-app graphite-app bot deleted the 12-10-test_linter_plugins_remove_non-deterministic_error_output_in_conformance_tester branch December 11, 2025 02:26
graphite-app bot pushed a commit that referenced this pull request 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.
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