From 2c9cd778370535d5d5cb8eb04a4ba7d34890717a Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 6 May 2026 18:45:24 +0100 Subject: [PATCH] Tests: Run slow `scanArtifactsForTokens` test in CI only by default --- src/artifact-scanner.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/artifact-scanner.test.ts b/src/artifact-scanner.test.ts index d2ecd18e2..6f68e647d 100644 --- a/src/artifact-scanner.test.ts +++ b/src/artifact-scanner.test.ts @@ -141,7 +141,12 @@ test("scanArtifactsForTokens handles files without tokens", async (t) => { } }); -if (os.platform() !== "win32") { +// This test is slow (extracts and scans a zip artifact), so by default we only run it in CI. Set +// RUN_SLOW_TESTS=1 to run it locally. +if ( + os.platform() !== "win32" && + (process.env.CI === "true" || process.env.RUN_SLOW_TESTS === "1") +) { test("scanArtifactsForTokens finds token in debug artifacts", async (t) => { t.timeout(15000); // 15 seconds const messages: LoggedMessage[] = [];