Skip to content

test(oxfmt/lsp): snapshot fixture uri instead of (fake) path#19883

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-01-test_oxfmt_lsp_snapshot_fixture_uri_instead_of_fake_path
Mar 2, 2026
Merged

test(oxfmt/lsp): snapshot fixture uri instead of (fake) path#19883
graphite-app[bot] merged 1 commit intomainfrom
03-01-test_oxfmt_lsp_snapshot_fixture_uri_instead_of_fake_path

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Mar 1, 2026

Because we are not testing URIs where there should be no local file related to it, it is better to show the URI

Copy link
Member Author

Sysix commented Mar 1, 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.

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Mar 1, 2026
@Sysix Sysix requested a review from Copilot March 1, 2026 15:31
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

Updates the oxfmt LSP test snapshot output to record a stable, sanitized document URI instead of a fixture “path”, improving portability across machines and environments.

Changes:

  • Replace the snapshot header from --- FILE + relative path to --- URI + sanitized URI.
  • Add uriSnapshotHeader() helper to normalize fixture file URIs to file://<fixture>/....
  • Update Vitest snapshot files to match the new header/output format.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
apps/oxfmt/test/lsp/utils.ts Introduces uriSnapshotHeader() and switches snapshot output to a URI-based header with fixture URI sanitization.
apps/oxfmt/test/lsp/format/snapshots/format.test.ts.snap Updates snapshots to expect --- URI and sanitized fixture/in-memory URIs.
apps/oxfmt/test/lsp/did_change_configuration/snapshots/format_after_config_change.test.ts.snap Updates snapshots to expect --- URI and sanitized fixture URIs.

@Sysix Sysix marked this pull request as ready for review March 1, 2026 15:38
@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Mar 2, 2026
Copy link
Member

leaysgur commented Mar 2, 2026

Merge activity

Because we are not testing URIs where there should be no local file related to it, it is better to show the URI
@graphite-app graphite-app bot force-pushed the 03-01-feat_oxfmt_lsp_support_other_schemes_beside_file___and_untitled___ branch from 3ec5794 to 4888a99 Compare March 2, 2026 00:33
@graphite-app graphite-app bot requested a review from camc314 as a code owner March 2, 2026 00:33
@graphite-app graphite-app bot force-pushed the 03-01-test_oxfmt_lsp_snapshot_fixture_uri_instead_of_fake_path branch from 817286f to 3415cf8 Compare March 2, 2026 00:33
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 2, 2026
Base automatically changed from 03-01-feat_oxfmt_lsp_support_other_schemes_beside_file___and_untitled___ to main March 2, 2026 00:40
@graphite-app graphite-app bot merged commit 3415cf8 into main Mar 2, 2026
20 checks passed
@graphite-app graphite-app bot deleted the 03-01-test_oxfmt_lsp_snapshot_fixture_uri_instead_of_fake_path branch March 2, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-formatter Area - Formatter 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.

3 participants