mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 10:39:32 +01:00
fix(test): make a bare vitest invocation use the isolated CI config
`npx vitest run` with no --config found no config file, so test/setup.ts never ran and HOME was not redirected: the suite wrote fixtures (clis.json with a test entry, users.json, webhook.json, intents.json, .env, settings.json values) into the developer's real ~/.codeman, and a running Codeman then loaded them on its next restart. A root vitest.config.ts re-exports config/vitest.ci.config.ts, so the default invocation is the isolated one; npm test and the browser/mobile/perf scripts keep passing their own --config. The shared temp-HOME teardown also retries on ENOTEMPTY, which failed whole files intermittently after every test had passed.
This commit is contained in:
1 parent
ce809eac41
commit
ef2001b1c1
4 files changed
+29
-1
No files matched your search
+3
-1
@@ -121,7 +121,9 @@ afterAll(async () => {
|
||||
if (originalPlaywrightBrowsersPath === undefined) delete process.env.PLAYWRIGHT_BROWSERS_PATH;
|
||||
else process.env.PLAYWRIGHT_BROWSERS_PATH = originalPlaywrightBrowsersPath;
|
||||
|
||||
rmSync(testHome, { recursive: true, force: true });
|
||||
// maxRetries: a straggling writer (a server persisting on shutdown) can recreate a file between
|
||||
// rmSync's readdir and rmdir, which fails the whole file with ENOTEMPTY after every test passed.
|
||||
rmSync(testHome, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
|
||||
});
|
||||
|
||||
// afterAll never fires for a fully-skipped test file (no tests execute), which
|
||||
|
||||
Reference in new issue
Block a user