perf(test): trim duplicate e2e suites and harden signal hooks

This commit is contained in:
Peter Steinberger
2026-02-13 16:46:31 +00:00
parent 45b9aad0f4
commit 1eccfa8934
8 changed files with 79 additions and 319 deletions

View File

@@ -109,9 +109,13 @@ async function resetGatewayTestState(options: { uniqueConfigRoot: boolean }) {
throw new Error("resetGatewayTestState called before temp home was initialized");
}
applyGatewaySkipEnv();
tempConfigRoot = options.uniqueConfigRoot
? await fs.mkdtemp(path.join(tempHome, "openclaw-test-"))
: path.join(tempHome, ".openclaw-test");
if (options.uniqueConfigRoot) {
tempConfigRoot = await fs.mkdtemp(path.join(tempHome, "openclaw-test-"));
} else {
tempConfigRoot = path.join(tempHome, ".openclaw-test");
await fs.rm(tempConfigRoot, { recursive: true, force: true });
await fs.mkdir(tempConfigRoot, { recursive: true });
}
setTestConfigRoot(tempConfigRoot);
sessionStoreSaveDelayMs.value = 0;
testTailnetIPv4.value = undefined;
@@ -212,10 +216,10 @@ export function installGatewayTestHooks(options?: { scope?: "test" | "suite" })
if (scope === "suite") {
beforeAll(async () => {
await setupGatewayTestHome();
await resetGatewayTestState({ uniqueConfigRoot: true });
await resetGatewayTestState({ uniqueConfigRoot: false });
});
beforeEach(async () => {
await resetGatewayTestState({ uniqueConfigRoot: true });
await resetGatewayTestState({ uniqueConfigRoot: false });
}, 60_000);
afterEach(async () => {
await cleanupGatewayTestHome({ restoreEnv: false });