From 1991542e59f64d46269b3ff942be77a5ff06e88f Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Mon, 12 Oct 2026 22:26:48 -0700 Subject: [PATCH] test(pcap): run the missing-path refusal only where captures are admitted (#2510) On hosts without an enforceable native bound (macOS), the provider refuses inspect_pcap_capture with capability_unavailable before it touches the path, which the unsupported-boundary test in the same file pins. The missing-path test expected invalid_request on every host, so it always failed on macOS while Linux and Windows CI stayed green. Co-authored-by: Claude Opus 5.5 --- .../pcap/pcapProviderCrossPlatform.test.ts | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/boundary/pcap/pcapProviderCrossPlatform.test.ts b/tests/boundary/pcap/pcapProviderCrossPlatform.test.ts index 3d7f28b54..59ff76c57 100644 --- a/tests/boundary/pcap/pcapProviderCrossPlatform.test.ts +++ b/tests/boundary/pcap/pcapProviderCrossPlatform.test.ts @@ -87,17 +87,22 @@ it.runIf(hasNativeBound)( }, ); -it("rejects a path that is not a readable file", async () => { - const result = await providerOver().execute({ - operation: "inspect_pcap_capture", - input: { path: "/nonexistent/definitely-missing.pcap" }, - }); - expect(result.ok).toBe(false); - if (result.ok) return; - expect(projectAnalysisError(result.error)).toMatchObject({ - code: "invalid_request", - }); -}); +// Hosts without a native bound refuse before touching the path; that order +// is pinned by the unsupported-boundary test below. +it.runIf(hasNativeBound)( + "rejects a path that is not a readable file", + async () => { + const result = await providerOver().execute({ + operation: "inspect_pcap_capture", + input: { path: "/nonexistent/definitely-missing.pcap" }, + }); + expect(result.ok).toBe(false); + if (result.ok) return; + expect(projectAnalysisError(result.error)).toMatchObject({ + code: "invalid_request", + }); + }, +); it("reports a missing binary as a capability gap", async () => { const provider = new PcapProvider({