Skip to content

Comments

fix(tests): sort snapshot cases correctly#734

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/02-23-fix_tests_sort_snapshot_cases_correctly
Feb 24, 2026
Merged

fix(tests): sort snapshot cases correctly#734
graphite-app[bot] merged 1 commit intomainfrom
c/02-23-fix_tests_sort_snapshot_cases_correctly

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Feb 23, 2026

Previously:

0, 1, 10, 11, 12, 13...

Now:

0, 1, 2, 3, 4, 5...

@camc314 camc314 marked this pull request as ready for review February 23, 2026 13:41
Copilot AI review requested due to automatic review settings February 23, 2026 13:41
Copy link
Contributor Author

camc314 commented Feb 23, 2026


How to use the Graphite Merge Queue

Add the label 0-merge to this PR to add it to 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.

Copy link

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 deterministic snapshot output ordering by switching snapshot entry sorting from plain lexicographic ordering to a “natural” numeric-aware ordering (so invalid-2 sorts before invalid-10), and updates stored snapshots accordingly.

Changes:

  • Replace sort.Strings(keys) with a custom natural sort (sortSnapshotKeys) for snapshot entry keys.
  • Add unit tests covering numeric-aware ordering for both test-case indices (invalid-N) and snapshot numbers (- N).
  • Regenerate/commit affected .snap files with the new deterministic ordering.

Reviewed changes

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

File Description
internal/rule_tester/snapshot.go Introduces natural numeric key comparison and uses it when writing snapshot files.
internal/rule_tester/snapshot_test.go Adds tests validating the new snapshot key ordering behavior.
internal/rule_tester/snapshots/*.snap Reorders snapshot entries to match the new natural sort order.

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

Copy link
Member

camchenry commented Feb 24, 2026

Merge activity

Previously:

0, 1, 10, 11, 12, 13...

Now:

0, 1, 2, 3, 4, 5...
@graphite-app graphite-app bot force-pushed the c/02-23-fix_tests_sort_snapshot_cases_correctly branch from b3995fa to 112cf3e Compare February 24, 2026 02:04
@graphite-app graphite-app bot merged commit 112cf3e into main Feb 24, 2026
8 checks passed
@graphite-app graphite-app bot deleted the c/02-23-fix_tests_sort_snapshot_cases_correctly branch February 24, 2026 02:11
@graphite-app graphite-app bot removed the 0-merge label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants