chore(dev): local test stack matches CI - #591
Merged
Merged
Conversation
`cargo test --workspace` could not pass on a fresh local checkout, for two independent reasons — and both failed in a way that read as a broken branch rather than a missing container. Valkey was simply absent. `oversla-sh`'s integration tests panic by design when `VALKEY_URL` is unreachable, so 14 tests failed on every local run; CI has had a `valkey` service all along. `make local-db` now starts it next to Postgres, `bin/worktree-env.sh` allocates a per-worktree port, and both `VALKEY_URL` and `REDIS_URL` land in `.env.local` — the second name so the resolver cache and rate limiter exercise their Redis backend locally the way they do in CI, instead of quietly falling back to the in-memory store. Postgres was the subtler one. With Valkey up, the api suite still failed by the hundred — tests that pass one at a time. Each holds two pools against a database it clones from a template, and the stock `max_connections = 100` runs out long before the suite does. CI raises the same knob to 500 in its "Tune Postgres" step; the dev compose Postgres now sets it too. The rest is making the trap unreachable rather than merely documented: `make test` prefers nextest (what CI runs, and per-process isolation the env-var tests want) and otherwise caps threads at 4, and `make test` / `make check` preflight both services with a hint instead of a wall of connection errors. The shortener stack moves to its own `SHORTENER_VALKEY_HOST_PORT` so it can run alongside the test store. Verified locally: 2721 passed, 13 skipped, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZvFwDS6Vm7xb17dExGLfm
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Code diff size+0 / −0 across 0 files (net +0) No production source files changed. Source files under |
angel-manuel
enabled auto-merge (squash)
August 31, 2026 16:02
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
cargo test --workspacecould not pass on a fresh local checkout, for two independent reasons — and both failed in a way that reads as a broken branch rather than a missing container.Valkey was simply absent
oversla-sh's integration tests panic by design whenVALKEY_URLis unreachable, so 14 tests failed on every local run. CI has had avalkeyservice all along.make local-dbnow starts Valkey next to Postgres.bin/worktree-env.shallocates a per-worktree Valkey port and writesVALKEY_HOST_PORT,VALKEY_URL, andREDIS_URLinto.env.local(whichmakere-exports).REDIS_URLis the second name deliberately: with it set, the resolver cache (D64) and the rate limiter exercise their Redis backend locally the way they do in CI, instead of quietly falling back to the in-memory store.Postgres was the subtler one
With Valkey up, the api suite still failed by the hundred — tests that pass one at a time. Each holds two pools (the test's own and the in-process API server's) against a database it clones from a template, and the stock
max_connections = 100runs out long before the suite does. CI raises the same knob to 500 in its "Tune Postgres" step; the dev compose Postgres now sets it too.Making the trap unreachable rather than merely documented
make testpreferscargo nextest run --workspace— what CI runs, and the per-process isolation a handful of env-var tests want — falling back tocargo test --workspace -- --test-threads=4, the number CLAUDE.md already recommended.make test/make checkpreflight both services viascripts/check-test-services.sh, which printsrun make local-dbinstead of a wall of connection errors.SHORTENER_VALKEY_HOST_PORT(6390) so it can run alongside the test store rather than fighting it for 6380.crates/oversla-sh/tests/integration.rsnow points atmake local-db; docs updated in CLAUDE.md and.env.example.Verification
Full workspace suite in a worktree, from
make local-db→make migrate→make test:cargo fmt --check,check-line-counts.sh,check-decisions.sh, and the pre-commit clippy gate are clean. No production code changes — dev tooling, compose, and docs only.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZvFwDS6Vm7xb17dExGLfm