Skip to content

test: snapshot-style testdata layout; underscore-prefixed fragments; example CI job - #22

Merged
mpyw merged 1 commit into
mainfrom
test/snapshot-restructure
Aug 18, 2026
Merged

test: snapshot-style testdata layout; underscore-prefixed fragments; example CI job#22
mpyw merged 1 commit into
mainfrom
test/snapshot-restructure

Conversation

@mpyw

@mpyw mpyw commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Reorganizes the test fixtures and wires the example module into CI.

  • e2e_test.gosnapshot_test.go (TestE2ETestSnapshots): it 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 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 under testdata/snapshots/.
  • Same underscore-prefix 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: 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; a mise run example task is added for local use.

🤖 Generated with Claude Code

…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

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.52%. Comparing base (5ec23dc) to head (623775f).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mpyw
mpyw merged commit 350c474 into main Aug 18, 2026
4 checks passed
@mpyw
mpyw deleted the test/snapshot-restructure branch August 19, 2026 06:49
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.

1 participant