mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 12:21:43 +00:00
Tests: isolate webhook path suite and reset cron auth state
This commit is contained in:
committed by
Peter Steinberger
parent
3bd0505433
commit
662f389f45
@@ -134,7 +134,7 @@ describe("VoiceCallWebhookServer stale call reaper", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("VoiceCallWebhookServer replay handling", () => {
|
describe("VoiceCallWebhookServer path matching", () => {
|
||||||
it("rejects lookalike webhook paths that only match by prefix", async () => {
|
it("rejects lookalike webhook paths that only match by prefix", async () => {
|
||||||
const verifyWebhook = vi.fn(() => ({ ok: true, verifiedRequestKey: "verified:req:prefix" }));
|
const verifyWebhook = vi.fn(() => ({ ok: true, verifiedRequestKey: "verified:req:prefix" }));
|
||||||
const parseWebhookEvent = vi.fn(() => ({ events: [], statusCode: 200 }));
|
const parseWebhookEvent = vi.fn(() => ({ events: [], statusCode: 200 }));
|
||||||
@@ -171,7 +171,9 @@ describe("VoiceCallWebhookServer replay handling", () => {
|
|||||||
await server.stop();
|
await server.stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("VoiceCallWebhookServer replay handling", () => {
|
||||||
it("acknowledges replayed webhook requests and skips event side effects", async () => {
|
it("acknowledges replayed webhook requests and skips event side effects", async () => {
|
||||||
const replayProvider: VoiceCallProvider = {
|
const replayProvider: VoiceCallProvider = {
|
||||||
...provider,
|
...provider,
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import fs from "node:fs/promises";
|
|||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles.js";
|
||||||
import { loadModelCatalog } from "../agents/model-catalog.js";
|
import { loadModelCatalog } from "../agents/model-catalog.js";
|
||||||
|
import { _probeThrottleInternals } from "../agents/model-fallback.js";
|
||||||
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
||||||
import type { CliDeps } from "../cli/deps.js";
|
import type { CliDeps } from "../cli/deps.js";
|
||||||
import { runCronIsolatedAgentTurn } from "./isolated-agent.js";
|
import { runCronIsolatedAgentTurn } from "./isolated-agent.js";
|
||||||
@@ -213,6 +215,8 @@ describe("runCronIsolatedAgentTurn", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
clearRuntimeAuthProfileStoreSnapshots();
|
||||||
|
_probeThrottleInternals.lastProbeAttempt.clear();
|
||||||
vi.mocked(runEmbeddedPiAgent).mockClear();
|
vi.mocked(runEmbeddedPiAgent).mockClear();
|
||||||
vi.mocked(loadModelCatalog).mockResolvedValue([]);
|
vi.mocked(loadModelCatalog).mockResolvedValue([]);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user