test: Extract shared conformance-test scaffolding into a common module #81

Merged
rosa merged 2 commits from test/shared-conformance-scaffolding into main 2026-07-04 01:56:07 +00:00
Owner

The three repository-conformance suites in crates/infra/tests/ each carried their own byte-identical copy of the both_adapters! macro plus near-identical create_user_request()/seed_user() helpers, because integration-test binaries cannot share code without a common module.

This moves that scaffolding into crates/infra/tests/common/mod.rs (the standard tests/common/mod.rs pattern):

  • both_adapters! moves unchanged and is re-exported with pub(crate) use, so each suite invokes it exactly as before.
  • create_user_request(name, email) standardises on the parameterised form the confirmation suite already used.
  • seed_user(repo, name, email) now takes the identity, so it can seed multiple distinct users; the post and authorization-code suites pass the previous fixed values, and the confirmation suite's scoped-displacement behaviour uses it for its two users (its other behaviour composes create_user_request directly, since it needs the email-confirmation id back).

Behaviour functions stay in their own suite files; the pg_*/mem_* test-name set is identical before and after (22 tests), and every helper is used by all three binaries, so no dead-code warnings. The ci mise task passes.

Closes #78

The three repository-conformance suites in `crates/infra/tests/` each carried their own byte-identical copy of the `both_adapters!` macro plus near-identical `create_user_request()`/`seed_user()` helpers, because integration-test binaries cannot share code without a common module. This moves that scaffolding into `crates/infra/tests/common/mod.rs` (the standard `tests/common/mod.rs` pattern): - `both_adapters!` moves unchanged and is re-exported with `pub(crate) use`, so each suite invokes it exactly as before. - `create_user_request(name, email)` standardises on the parameterised form the confirmation suite already used. - `seed_user(repo, name, email)` now takes the identity, so it can seed multiple distinct users; the post and authorization-code suites pass the previous fixed values, and the confirmation suite's scoped-displacement behaviour uses it for its two users (its other behaviour composes `create_user_request` directly, since it needs the email-confirmation id back). Behaviour functions stay in their own suite files; the `pg_*`/`mem_*` test-name set is identical before and after (22 tests), and every helper is used by all three binaries, so no dead-code warnings. The `ci` mise task passes. Closes #78
test: Extract shared conformance-test scaffolding into a common module
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
935640dc32
test: Make both_adapters! hygienic via absolute adapter paths
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
345b5984b7
The macro previously resolved PgPool, PostgresAppRepository, and
MemoryAppRepo at the call site, forcing every suite to import adapter
types it never names. Spell them absolutely in the expansion so the
common module is self-contained, and drop the now-unused imports.
rosa merged commit a3e9390fcb into main 2026-07-04 01:56:07 +00:00
rosa deleted branch test/shared-conformance-scaffolding 2026-07-04 01:56:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rosa/vernier!81
No description provided.