mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 03:51:25 +00:00
perf(test): trim duplicate e2e suites and harden signal hooks
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user