38f446bb6f
fix(test): isolate $HOME in mechanical.test.ts so E2E suite stops clobbering user config ( #434 )
...
mechanical.test.ts shells out to `gbrain init --non-interactive`,
`gbrain import`, and similar commands via Bun.spawnSync. The four
`cliEnv()` helpers in this file forward `process.env` unchanged, so
`gbrain init` ends up calling saveConfig() against the developer's real
$HOME/.gbrain/config.json, overwriting their production database_url
with the test container's URL on every `bun run test:e2e` invocation.
Sibling test/e2e/migration-flow.test.ts already solved this with a
module-level temp HOME and an afterAll restore. Mirror that pattern in
mechanical.test.ts.
Verified by md5'ing ~/.gbrain/config.json before and after running the
Setup Journey, Init Edge Cases, Schema Idempotency, RLS Verification,
Doctor Command, and Parallel Import describe blocks — config hash is
identical pre and post (26 passing tests, 0 failures, 0 mutations to
the user's real config).
Co-authored-by: Seth Armbrust <setharmbrust@seth.local >
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-07-23 13:24:40 -07:00
..
2026-04-18 16:57:38 +08:00
2026-04-09 10:17:13 -07:00
2026-05-07 21:52:58 -07:00
2026-07-23 12:02:56 -07:00
2026-05-09 22:58:19 -07:00
2026-06-21 06:36:43 -07:00
2026-05-24 11:37:03 -07:00
2026-05-07 21:52:58 -07:00
2026-05-22 11:53:11 -07:00
2026-05-27 08:50:53 -07:00
2026-05-23 08:49:28 -07:00
2026-07-21 00:04:41 -07:00
2026-05-06 21:14:34 -07:00
2026-05-11 22:54:35 -07:00
2026-04-29 23:46:36 -07:00
2026-05-14 19:50:50 -04:00
2026-07-20 14:51:47 -07:00
2026-05-24 09:30:57 -07:00
2026-06-03 06:43:11 -07:00
2026-05-23 08:49:28 -07:00
2026-06-03 15:24:00 -07:00
2026-05-23 08:49:28 -07:00
2026-07-20 16:57:53 -07:00
2026-05-10 20:06:31 -07:00
2026-05-09 16:57:47 -07:00
2026-05-07 21:52:58 -07:00
2026-06-01 22:01:14 -07:00
2026-07-20 12:05:04 -07:00
2026-06-03 08:59:39 -07:00
2026-07-22 18:46:44 -07:00
2026-04-30 01:23:29 -07:00
2026-06-03 15:24:00 -07:00
2026-07-21 12:29:35 -07:00
2026-05-08 17:07:51 -07:00
2026-07-23 13:09:42 -07:00
2026-05-30 10:30:56 -07:00
2026-05-14 21:22:10 -07:00
2026-07-23 12:02:36 -07:00
2026-05-18 21:26:12 -07:00
2026-05-07 21:52:58 -07:00
2026-07-23 12:02:46 -07:00
2026-06-01 22:13:19 -07:00
2026-05-01 09:02:43 -07:00
2026-05-17 08:32:03 -07:00
2026-05-24 21:50:08 -07:00
2026-05-18 21:26:12 -07:00
2026-05-10 06:34:40 -07:00
2026-05-25 15:10:23 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-07-13 00:09:16 -07:00
2026-05-11 19:25:48 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-24 11:37:03 -07:00
2026-04-26 20:45:05 -07:00
2026-07-21 18:45:23 -07:00
2026-07-22 18:46:44 -07:00
2026-05-23 10:01:08 -07:00
2026-05-23 10:01:08 -07:00
2026-07-20 12:05:04 -07:00
2026-05-09 16:57:47 -07:00
2026-05-25 14:43:12 -07:00
2026-07-20 13:56:00 -07:00
2026-05-21 18:57:05 -07:00
2026-05-11 23:02:03 -07:00
2026-05-24 11:37:03 -07:00
2026-06-10 22:00:36 -07:00
2026-07-22 18:46:44 -07:00
2026-05-22 21:04:30 -07:00
2026-05-07 21:52:58 -07:00
2026-07-22 18:46:44 -07:00
2026-07-23 13:24:40 -07:00
2026-05-09 16:57:47 -07:00
2026-07-13 00:08:52 -07:00
2026-07-22 18:46:44 -07:00
2026-05-09 16:57:47 -07:00
2026-05-10 12:49:14 -07:00
2026-05-10 12:49:14 -07:00
2026-05-24 11:37:03 -07:00
2026-05-09 16:57:47 -07:00
2026-05-24 11:37:03 -07:00
2026-05-24 11:37:03 -07:00
2026-05-24 11:37:03 -07:00
2026-07-22 18:46:44 -07:00
2026-05-24 11:37:03 -07:00
2026-05-19 13:12:40 -07:00
2026-05-09 16:57:47 -07:00
2026-07-13 00:08:52 -07:00
2026-05-07 21:52:58 -07:00
2026-07-22 18:46:44 -07:00
2026-05-09 16:57:47 -07:00
2026-06-03 07:09:20 -07:00
2026-05-31 08:20:25 -07:00
2026-06-24 06:05:16 -07:00
2026-05-11 21:49:57 -07:00
2026-05-11 21:49:57 -07:00
2026-04-23 19:34:27 -07:00
2026-05-25 14:56:38 -07:00
2026-06-14 09:32:58 -07:00
2026-06-12 07:28:13 -07:00
2026-05-23 10:21:59 -07:00
2026-07-02 08:00:58 -07:00
2026-06-03 08:59:39 -07:00
2026-05-09 16:57:47 -07:00
2026-06-03 08:42:25 -07:00
2026-06-01 23:03:09 -07:00
2026-05-07 21:52:58 -07:00
2026-07-22 14:47:11 -07:00
2026-05-22 13:38:07 -07:00
2026-05-20 09:19:18 -07:00
2026-06-03 06:28:21 -07:00
2026-07-22 18:46:44 -07:00
2026-04-30 23:17:54 -07:00
2026-06-03 06:20:03 -07:00
2026-06-03 06:20:03 -07:00
2026-05-22 21:18:09 -07:00
2026-05-09 16:57:47 -07:00
2026-07-21 12:44:46 -07:00
2026-06-03 15:24:00 -07:00
2026-05-20 13:55:12 -07:00
2026-07-22 00:23:10 -07:00
2026-05-31 08:20:25 -07:00
2026-05-18 12:53:01 -07:00
2026-05-19 18:12:01 -07:00
2026-05-09 16:57:47 -07:00
2026-07-23 12:02:46 -07:00
2026-05-14 19:50:50 -04:00
2026-05-09 16:57:47 -07:00
2026-06-21 06:36:43 -07:00
2026-04-29 22:21:07 -07:00
2026-07-20 13:56:00 -07:00
2026-07-20 13:56:00 -07:00
2026-07-20 13:56:00 -07:00
2026-05-14 19:50:50 -04:00
2026-05-11 22:54:35 -07:00
2026-05-25 14:43:12 -07:00
2026-06-03 15:24:00 -07:00
2026-05-26 16:58:18 -07:00
2026-05-30 10:30:56 -07:00
2026-07-17 14:41:25 -07:00
2026-05-11 19:25:48 -07:00
2026-07-23 12:02:56 -07:00
2026-05-07 23:07:00 -07:00
2026-05-10 06:34:40 -07:00
2026-05-22 13:38:07 -07:00
2026-07-13 00:09:27 -07:00
2026-05-22 22:37:15 -07:00
2026-05-27 07:01:28 -07:00
2026-07-22 18:46:44 -07:00
2026-05-21 22:11:00 -07:00
2026-07-23 12:02:56 -07:00
2026-05-09 20:46:34 -07:00
2026-05-19 17:14:53 -07:00
2026-06-14 09:32:58 -07:00
2026-05-24 11:37:03 -07:00
2026-05-12 14:33:29 -07:00
2026-04-26 15:49:48 -07:00
2026-05-17 08:00:29 -07:00
2026-05-24 11:37:03 -07:00