Draft
Conversation
Add an abstract type `SnapshotTestSuite` with a `run_snapshot_tests` driver that handles test iteration, filtering, and skipping. Packages define a marker type, overload a few functions (snapshot_tests, snapshot_expected_dir, snapshot_produce), and get automatic plumbing. Supports filtering by exact name or predicate function, skip lists, and optional pre-snapshot assertions via snapshot_test_extras. The existing test_snapshot API is untouched. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
talf301
commented
Feb 11, 2026
Comment on lines
+80
to
+84
| function run_snapshot_tests(suite::SnapshotTestSuite; filter=nothing, skip=String[]) | ||
| cases = snapshot_tests(suite) | ||
| expected = snapshot_expected_dir(suite) | ||
| allow = snapshot_allow_additions(suite) | ||
| pred = _make_filter(filter) |
Collaborator
Author
There was a problem hiding this comment.
Could we maybe also just have a run_snapshot_test syntactic sugar function that runs a single snapshot test
…test
- Change SnapshotTestSuite from abstract type to parameterized struct
SnapshotTestSuite{X}, following the Salsa Keyspace{X} pattern. Users
dispatch on SnapshotTestSuite{:my_symbol} instead of defining/exporting
concrete subtypes.
- Add run_snapshot_test(suite, name) convenience function for running a
single snapshot test by name.
- Update tests to use parameterized types with unique symbols per testset.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Julia requires global method definitions to be at the top level, not inside local scopes like `mktempdir() do ... end` blocks. Use Ref variables at module level to pass test-specific data (cases, expected dirs) into the parameterized type method implementations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SnapshotTestSuiteabstract type andrun_snapshot_testsdriver for eliminating snapshot test boilerplatesnapshot_tests,snapshot_expected_dir,snapshot_produce(and optionallysnapshot_test_extras,snapshot_allow_additions)run_snapshot_testshandles iteration,@testsetwrapping, filter (string/function), and skip liststest_snapshotAPI is completely untouched — this is purely additiveUsage
Test plan
🤖 Generated with Claude Code