Restore process env after memory-mount tests - #465
Merged
TheGreatAxios merged 2 commits intoAug 29, 2026
Merged
TheGreatAxios merged 2 commits into
TheGreatAxios merged 2 commits into
Conversation
afterEach currently deletes DATABASE_URL when a test never called stashEnv. Snapshot KEYS at module load and assert they survive a non-stash resolveMemoryEmbed test so later drizzle suites in the same process still see the original env.
Snapshot KEYS at module load and restore them in afterEach. stashEnv only clears for the current test. Non-stash resolveMemoryEmbed tests no longer delete DATABASE_URL, so later drizzle suites in the same Bun process still see the original env.
This was referenced Aug 29, 2026
TheGreatAxios
commented
Aug 29, 2026
TheGreatAxios
left a comment
Contributor
Author
There was a problem hiding this comment.
critique · comment
afterEach restores KEYS (including DATABASE_URL) from the module-load snapshot; stashEnv only clears for the current test.
- apps/hub/src/memory-mount.test.ts:24-52 — originals captured at load; restoreOriginalEnv writes them back after every test.
- apps/hub/src/memory-mount.test.ts:54-58 — stashEnv only clears.
- apps/hub/src/memory-mount.test.ts:112-116 — pin after a non-stash resolveMemoryEmbed path.
No product-code changes outside this file. Walking-skeleton on main should go green once this lands.
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.
Fixes https://linear.app/abklabs/issue/CL-7182/restore-process-env-after-memory-mount-tests-so-walking-skeleton-stays
apps/hub/src/memory-mount.test.tsdeletedDATABASE_URLinafterEachwhen a test never calledstashEnv. The walking-skeleton job then runs everyDATABASE_URL-gated suite in one Bun process; later drizzle suites saw no URL and failed underE2E_REQUIRED=1. Main has been red on that step since #462.This snapshot KEYS at module load and restores them after every test.
stashEnvonly clears for the current test. A same-file assertion locks the restore after a non-stashresolveMemoryEmbedpath.Local proof:
bun test apps/hub/src/memory-mount.test.ts packages/evals/src/store/store.test.ts— the evals store suite (the first CI failure) now runs after memory-mount and passes.