Skip to content

test(linter/plugins): conformance tester shorten filename in test cases in snapshots#18682

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/01-28-test_linter_plugins_conformance_tester_shorten_filename_in_test_cases_in_snapshots
Jan 28, 2026
Merged

test(linter/plugins): conformance tester shorten filename in test cases in snapshots#18682
graphite-app[bot] merged 1 commit intomainfrom
om/01-28-test_linter_plugins_conformance_tester_shorten_filename_in_test_cases_in_snapshots

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 28, 2026

eslint-plugin-sonarjs sets filename property of test cases to an absolute path. Potentially other plugins do this too.

In snapshots, convert to a path relative to repo root, so that snapshot contents will be the same on any machine it's run on. Also conform to unix-style /s.

Copy link
Member Author

overlookmotel commented Jan 28, 2026


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 force-pushed the om/01-28-test_linter_plugins_conformance_tester_shorten_filename_in_test_cases_in_snapshots branch from de0192e to cacafcf Compare January 28, 2026 22:22
@overlookmotel overlookmotel marked this pull request as ready for review January 28, 2026 22:23
Copilot AI review requested due to automatic review settings January 28, 2026 22:23
Copy link
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 updates the conformance test reporter to normalize filename properties in test case snapshots. When plugins like eslint-plugin-sonarjs provide absolute file paths in test cases, these are now converted to relative paths (from repo root) with Unix-style forward slashes, ensuring snapshot consistency across different machines and operating systems.

Changes:

  • Added logic to shorten absolute filename paths to relative paths in test case snapshots
  • Applied slash normalization to ensure consistent Unix-style path separators

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

@overlookmotel overlookmotel self-assigned this Jan 28, 2026
@overlookmotel overlookmotel changed the base branch from om/01-28-test_linter_plugins_conformance_tester_identify_known_parsers_by_parse_function to graphite-base/18682 January 28, 2026 22:37
@overlookmotel overlookmotel force-pushed the om/01-28-test_linter_plugins_conformance_tester_shorten_filename_in_test_cases_in_snapshots branch from cacafcf to 5f1e6c8 Compare January 28, 2026 22:38
@overlookmotel overlookmotel changed the base branch from graphite-base/18682 to om/01-28-test_linter_plugins_conformance_tester_identify_known_parsers_by_parse_function January 28, 2026 22:38
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 28, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 28, 2026

Merge activity

…ases in snapshots (#18682)

`eslint-plugin-sonarjs` sets `filename` property of test cases to an absolute path. Potentially other plugins do this too.

In snapshots, convert to a path relative to repo root, so that snapshot contents will be the same on any machine it's run on. Also conform to unix-style `/`s.
@graphite-app graphite-app bot force-pushed the om/01-28-test_linter_plugins_conformance_tester_identify_known_parsers_by_parse_function branch from 8e79f9e to c3d1ae9 Compare January 28, 2026 23:04
@graphite-app graphite-app bot force-pushed the om/01-28-test_linter_plugins_conformance_tester_shorten_filename_in_test_cases_in_snapshots branch from 5f1e6c8 to 026e475 Compare January 28, 2026 23:05
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 28, 2026
Base automatically changed from om/01-28-test_linter_plugins_conformance_tester_identify_known_parsers_by_parse_function to main January 28, 2026 23:11
@graphite-app graphite-app bot merged commit 026e475 into main Jan 28, 2026
20 checks passed
@graphite-app graphite-app bot deleted the om/01-28-test_linter_plugins_conformance_tester_shorten_filename_in_test_cases_in_snapshots branch January 28, 2026 23:11
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