test: snapshot-style testdata layout; underscore-prefixed fragments; example CI job - #22
Merged
Conversation
…example CI job
- Rename e2e_test.go -> snapshot_test.go (TestE2E -> TestSnapshots): the test is a
snapshot suite, not an end-to-end scenario.
- Flatten testdata/e2e/ into testdata/: the template is testdata/all_in_one.sql,
its reusable fragments are underscore-prefixed (testdata/_all_in_one.scope.sql,
_all_in_one.active.sql) by convention, and every generated artifact
(all_in_one.expanded.sql, all_in_one.<case>.{prepared,embedded}.sql) lives under
testdata/snapshots/.
- Adopt the same underscore-prefix fragment convention in the example module
(sql/users/_scope.sql, _active.sql; sql/audit_logs/_window.sql, _since.sql),
dropping the fragment/ subdirectories. The embed becomes //go:embed all:sql so
the _-prefixed files are included.
- CI: add a separate `example` job (mise run example) that builds/vets/lints/
deadcode/tests the example module. It is deliberately excluded from coverage,
hence a separate job from `check`/`cover`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAydPGeSHjZvJv22oz4P6d
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
=======================================
Coverage 96.52% 96.52%
=======================================
Files 11 11
Lines 951 951
=======================================
Hits 918 918
Misses 21 21
Partials 12 12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Reorganizes the test fixtures and wires the example module into CI.
e2e_test.go→snapshot_test.go(TestE2E→TestSnapshots): it is a snapshot suite, not an end-to-end scenario.testdata/e2e/intotestdata/: the template istestdata/all_in_one.sql; its reusable fragments are underscore-prefixed by convention (testdata/_all_in_one.scope.sql,_all_in_one.active.sql); every generated artifact (all_in_one.expanded.sql,all_in_one.<case>.{prepared,embedded}.sql) lives undertestdata/snapshots/.sql/users/_scope.sql,_active.sql;sql/audit_logs/_window.sql,_since.sql), dropping thefragment/subdirectories. The embed becomes//go:embed all:sqlso the_-prefixed files are included.examplejob (mise run example) that builds/vets/lints/deadcode/tests the example module. It is deliberately excluded from coverage, hence a separate job fromcheck/cover; amise run exampletask is added for local use.🤖 Generated with Claude Code