fix(dev): mount ./tests so pre-commit compiles integration tests (PMS-640) #434

Merged
nrupard merged 2 commits from fix/PMS-640-precommit-compile-integration-tests into main 2026-07-09 17:19:11 +02:00
Owner

What

Mount ./tests into the dev-compose server service so just pre-commit compiles the tests/*.rs integration binaries.

Why

The container just pre-commit runs in mounted src/crates/Cargo.*/build.rs/migrations but not ./tests, so cargo {check,clippy} --all-targets inside it saw no integration tests and compiled lib + bins only. A change that broke the shared harness (tests/common/mod.rs) - e.g. PMS-638 changing create_api_router's mailer parameter to Arc<SharedMailer> - passed the local hook green and only failed in CI clippy, which checks out the full repo.

Change

  • compose.dev.yml: add - ./tests:/app/tests to the server service volumes.
  • justfile: note in the pre-commit comment that --all-targets now covers the integration binaries (compile-only; the Postgres-backed run stays in just test-integration).

Verification

Injected a type error into tests/common/mod.rs and ran just pre-commit: it now fails (exit 101, error[E0308] at tests/common/mod.rs, "could not compile ... test 'tenants'/'notifications'/...") - the class of break that previously slipped through. Reverted the injection; the clean hook passes (compiling the integration tests).

Fixes PMS-640.

## What Mount `./tests` into the dev-compose `server` service so `just pre-commit` compiles the `tests/*.rs` integration binaries. ## Why The container `just pre-commit` runs in mounted `src/crates/Cargo.*/build.rs/migrations` but not `./tests`, so `cargo {check,clippy} --all-targets` inside it saw no integration tests and compiled lib + bins only. A change that broke the shared harness (`tests/common/mod.rs`) - e.g. PMS-638 changing `create_api_router`'s `mailer` parameter to `Arc<SharedMailer>` - passed the local hook green and only failed in CI clippy, which checks out the full repo. ## Change - `compose.dev.yml`: add `- ./tests:/app/tests` to the `server` service volumes. - `justfile`: note in the `pre-commit` comment that `--all-targets` now covers the integration binaries (compile-only; the Postgres-backed run stays in `just test-integration`). ## Verification Injected a type error into `tests/common/mod.rs` and ran `just pre-commit`: it now fails (`exit 101`, `error[E0308]` at `tests/common/mod.rs`, "could not compile ... test 'tenants'/'notifications'/...") - the class of break that previously slipped through. Reverted the injection; the clean hook passes (compiling the integration tests). Fixes PMS-640.
fix(dev): mount ./tests so pre-commit compiles the integration tests
Some checks failed
Check / fmt + clippy + build + tests (pull_request) Successful in 1m21s
E2E / Playwright against staging (pull_request) Failing after 2m28s
Integration / integration tests (pull_request) Successful in 5m15s
937502035e
The dev-compose `server` container that `just pre-commit` runs in mounted src/crates/Cargo/build.rs/migrations but not ./tests, so `cargo {check,clippy} --all-targets` inside it compiled lib + bins only, never the tests/*.rs integration binaries. A change that broke the shared harness (e.g. PMS-638 altering create_api_router's signature) passed the local hook and only failed in CI clippy. Mount ./tests into the service so --all-targets compiles the integration tests too; the Postgres-backed run stays compile-only here (just test-integration still owns the DB path). Verified by injecting a type error into tests/common/mod.rs and confirming pre-commit now fails on it.

#PMS-640
Merge branch 'main' into fix/PMS-640-precommit-compile-integration-tests
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 53s
Check / fmt + clippy + build + tests (pull_request) Successful in 3m41s
Create release / Gate (release-branch merges only) (pull_request) Successful in 2s
Create release / Create release from merged PR (pull_request) Has been skipped
Integration / integration tests (pull_request) Successful in 11m31s
15d31416a3
nrupard scheduled this pull request to auto merge when all checks succeed 2026-07-09 17:15:38 +02:00
nrupard deleted branch fix/PMS-640-precommit-compile-integration-tests 2026-07-09 17:19:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
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
psa-systems/mokosh-server!434
No description provided.