perf(test): skip heavy boot paths in reply suites

This commit is contained in:
Peter Steinberger
2026-02-14 19:25:09 +00:00
parent 857db619e1
commit 387fb40745
4 changed files with 21 additions and 7 deletions

View File

@@ -83,15 +83,23 @@ describe("block streaming", () => {
});
afterAll(async () => {
await fs.rm(fixtureRoot, {
recursive: true,
force: true,
maxRetries: 10,
retryDelay: 50,
});
if (process.platform === "win32") {
await fs.rm(fixtureRoot, {
recursive: true,
force: true,
maxRetries: 10,
retryDelay: 50,
});
} else {
await fs.rm(fixtureRoot, {
recursive: true,
force: true,
});
}
});
beforeEach(() => {
vi.stubEnv("OPENCLAW_TEST_FAST", "1");
piEmbeddedMock.abortEmbeddedPiRun.mockReset().mockReturnValue(false);
piEmbeddedMock.queueEmbeddedPiMessage.mockReset().mockReturnValue(false);
piEmbeddedMock.isEmbeddedPiRunActive.mockReset().mockReturnValue(false);

View File

@@ -1,5 +1,5 @@
import { join } from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { withTempHome as withTempHomeBase } from "../../test/helpers/temp-home.js";
const runEmbeddedPiAgentMock = vi.fn();
@@ -71,6 +71,10 @@ afterEach(() => {
});
describe("getReplyFromConfig typing (heartbeat)", () => {
beforeEach(() => {
vi.stubEnv("OPENCLAW_TEST_FAST", "1");
});
it("starts typing for normal runs", async () => {
await withTempHome(async (home) => {
runEmbeddedPiAgentMock.mockResolvedValueOnce({

View File

@@ -102,6 +102,7 @@ describe("RawBody directive parsing", () => {
});
beforeEach(() => {
vi.stubEnv("OPENCLAW_TEST_FAST", "1");
agentMocks.runEmbeddedPiAgent.mockReset();
agentMocks.loadModelCatalog.mockReset();
agentMocks.loadModelCatalog.mockResolvedValue([

View File

@@ -102,6 +102,7 @@ describe("runCronIsolatedAgentTurn", () => {
});
beforeEach(() => {
vi.stubEnv("OPENCLAW_TEST_FAST", "1");
vi.mocked(runEmbeddedPiAgent).mockReset();
vi.mocked(loadModelCatalog).mockResolvedValue([]);
vi.mocked(runSubagentAnnounceFlow).mockReset().mockResolvedValue(true);