test: trim slow CI hotspot coverage · openclaw/openclaw@66f9410
steipete
·
2026-04-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -28,6 +28,14 @@ vi.mock("@larksuiteoapi/node-sdk", () => ({
|
28 | 28 | ), |
29 | 29 | })); |
30 | 30 | |
| 31 | +vi.mock("./monitor.state.js", async (importOriginal) => { |
| 32 | +const actual = await importOriginal<typeof import("./monitor.state.js")>(); |
| 33 | +return { |
| 34 | + ...actual, |
| 35 | +FEISHU_WEBHOOK_BODY_TIMEOUT_MS: 50, |
| 36 | +}; |
| 37 | +}); |
| 38 | + |
31 | 39 | import type { RuntimeEnv } from "../runtime-api.js"; |
32 | 40 | import { |
33 | 41 | clearFeishuWebhookRateLimitStateForTest, |
@@ -197,10 +205,10 @@ describe("Feishu webhook security hardening", () => {
|
197 | 205 | }, |
198 | 206 | monitorFeishuProvider, |
199 | 207 | async (url) => { |
200 | | -const result = await waitForSlowBodyTimeoutResponse(url, 15_000); |
| 208 | +const result = await waitForSlowBodyTimeoutResponse(url, 1_000); |
201 | 209 | expect(result.body).toContain("408 Request Timeout"); |
202 | 210 | expect(result.body).toContain("Request body timeout"); |
203 | | -expect(result.elapsedMs).toBeLessThan(12_000); |
| 211 | +expect(result.elapsedMs).toBeLessThan(500); |
204 | 212 | }, |
205 | 213 | ); |
206 | 214 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { describe, expect, it } from "vitest"; |
2 | 2 | import { splitSdkTools } from "./pi-embedded-runner.js"; |
| 3 | +import { |
| 4 | +collectRegisteredToolNames, |
| 5 | +toSessionToolAllowlist, |
| 6 | +} from "./pi-embedded-runner/tool-name-allowlist.js"; |
3 | 7 | import { createStubTool } from "./test-helpers/pi-tool-stubs.js"; |
4 | 8 | |
5 | 9 | describe("splitSdkTools", () => { |
@@ -38,4 +42,15 @@ describe("splitSdkTools", () => {
|
38 | 42 | "browser", |
39 | 43 | ]); |
40 | 44 | }); |
| 45 | + |
| 46 | +it("keeps OpenClaw-managed custom tools in Pi's session allowlist", () => { |
| 47 | +const { customTools } = splitSdkTools({ |
| 48 | +tools: [createStubTool("read"), createStubTool("sessions_spawn")], |
| 49 | +sandboxEnabled: true, |
| 50 | +}); |
| 51 | +const allowlist = toSessionToolAllowlist(collectRegisteredToolNames(customTools)); |
| 52 | + |
| 53 | +expect(customTools.map((tool) => tool.name)).toContain("sessions_spawn"); |
| 54 | +expect(allowlist).toContain("sessions_spawn"); |
| 55 | +}); |
41 | 56 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -67,20 +67,4 @@ describe("resolveFollowupDeliveryPayloads", () => {
|
67 | 67 | }), |
68 | 68 | ).toEqual([]); |
69 | 69 | }); |
70 | | - |
71 | | -it("does not suppress replies when account differs", () => { |
72 | | -expect( |
73 | | -resolveFollowupDeliveryPayloads({ |
74 | | -cfg: baseConfig, |
75 | | -payloads: [{ text: "hello world!" }], |
76 | | -messageProvider: "heartbeat", |
77 | | -originatingChannel: "telegram", |
78 | | -originatingTo: "268300329", |
79 | | -originatingAccountId: "personal", |
80 | | -sentTargets: [ |
81 | | -{ tool: "telegram", provider: "telegram", to: "268300329", accountId: "work" }, |
82 | | -], |
83 | | -}), |
84 | | -).toEqual([{ text: "hello world!" }]); |
85 | | -}); |
86 | 70 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。