Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b5763e

Browse files
committed
Skip slow test on Windows
1 parent3322491 commit6b5763e

File tree

1 file changed

+37
-35
lines changed

1 file changed

+37
-35
lines changed

‎src/artifact-scanner.test.ts‎

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -56,41 +56,43 @@ test("scanArtifactsForTokens handles files without tokens", async (t) => {
5656
}
5757
});
5858

59-
test("scanArtifactsForTokens finds token in debug artifacts",async(t)=>{
60-
t.timeout(os.platform()==="win32" ?30000 :10000);// 30 seconds on Windows, 10 seconds on other platforms
61-
constmessages:LoggedMessage[]=[];
62-
constlogger=getRecordingLogger(messages,{logToConsole:false});
63-
// The zip here is a regression test based on
64-
// https://github.com/github/codeql-action/security/advisories/GHSA-vqf5-2xx6-9wfm
65-
consttestZip=path.join(
66-
__dirname,
67-
"..",
68-
"src",
69-
"testdata",
70-
"debug-artifacts-with-fake-token.zip",
71-
);
59+
if(os.platform()!=="win32"){
60+
test("scanArtifactsForTokens finds token in debug artifacts",async(t)=>{
61+
t.timeout(15000);// 15 seconds
62+
constmessages:LoggedMessage[]=[];
63+
constlogger=getRecordingLogger(messages,{logToConsole:false});
64+
// The zip here is a regression test based on
65+
// https://github.com/github/codeql-action/security/advisories/GHSA-vqf5-2xx6-9wfm
66+
consttestZip=path.join(
67+
__dirname,
68+
"..",
69+
"src",
70+
"testdata",
71+
"debug-artifacts-with-fake-token.zip",
72+
);
7273

73-
// This zip file contains a nested structure with a fake token in:
74-
// my-db-java-partial.zip/trap/java/invocations/kotlin.9017231652989744319.trap
75-
consterror=awaitt.throwsAsync(
76-
async()=>awaitscanArtifactsForTokens([testZip],logger),
77-
);
74+
// This zip file contains a nested structure with a fake token in:
75+
// my-db-java-partial.zip/trap/java/invocations/kotlin.9017231652989744319.trap
76+
consterror=awaitt.throwsAsync(
77+
async()=>awaitscanArtifactsForTokens([testZip],logger),
78+
);
7879

79-
t.regex(
80-
error?.message||"",
81-
/Found.*potentialGitHubtoken/,
82-
"Should detect token in nested zip",
83-
);
84-
t.regex(
85-
error?.message||"",
86-
/kotlin\.9017231652989744319\.trap/,
87-
"Should report the .trap file containing the token",
88-
);
80+
t.regex(
81+
error?.message||"",
82+
/Found.*potentialGitHubtoken/,
83+
"Should detect token in nested zip",
84+
);
85+
t.regex(
86+
error?.message||"",
87+
/kotlin\.9017231652989744319\.trap/,
88+
"Should report the .trap file containing the token",
89+
);
8990

90-
constlogOutput=messages.map((msg)=>msg.message).join("\n");
91-
t.regex(
92-
logOutput,
93-
/^Extractinggzfile:.*\.gz$/m,
94-
"Logs should show that .gz files were extracted",
95-
);
96-
});
91+
constlogOutput=messages.map((msg)=>msg.message).join("\n");
92+
t.regex(
93+
logOutput,
94+
/^Extractinggzfile:.*\.gz$/m,
95+
"Logs should show that .gz files were extracted",
96+
);
97+
});
98+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp