@@ -5,13 +5,9 @@ const assert = require('node:assert/strict')
55const { runAction } = require ( '../helpers/run-action' )
66const { startFakeGitHub, humanComment } = require ( '../helpers/fake-github' )
77const { kicsResults, query, finding } = require ( '../helpers/fixtures' )
8- const { knownBug } = require ( '../helpers/known-bug' )
98
109const KICS_FOUND_RESULTS = '50'
1110
12- const SILENT_FAILURE =
13- 'main() swallows every exception, so a KICS failure is never reported when GitHub or results.json cannot be used'
14-
1511test ( 'pull request comment' , async ( t ) => {
1612 await t . test ( 'is not posted unless enable_comments is on (the default)' , async ( t ) => {
1713 const fake = await startFakeGitHub ( t )
@@ -171,19 +167,19 @@ test('workflow status follows the KICS exit code', async (t) => {
171167 assert . equal ( run . code , 0 )
172168 } )
173169
174- await t . test ( 'fails when KICS fails and the PR comment cannot be posted' , knownBug ( SILENT_FAILURE ) , async ( t ) => {
170+ await t . test ( 'fails when KICS fails and the PR comment cannot be posted' , async ( t ) => {
175171 const fake = await startFakeGitHub ( t , { failWith : 500 } )
176172 const run = await runAction ( t , { results : kicsResults ( ) , kicsExitCode : KICS_FOUND_RESULTS , inputs : { enable_comments : 'true' } , apiUrl : fake . url } )
177173 assert . equal ( run . code , 1 , 'a GitHub API outage must not turn a failed scan into a green build' )
178174 } )
179175
180- await t . test ( 'fails when KICS failed and wrote no results.json' , knownBug ( SILENT_FAILURE ) , async ( t ) => {
176+ await t . test ( 'fails when KICS failed and wrote no results.json' , async ( t ) => {
181177 const run = await runAction ( t , { kicsExitCode : '126' } )
182178 assert . equal ( run . code , 1 , run . stdout + run . stderr )
183179 assert . ok ( run . errors . length > 0 )
184180 } )
185181
186- await t . test ( 'reports a missing results.json instead of passing silently' , knownBug ( SILENT_FAILURE ) , async ( t ) => {
182+ await t . test ( 'reports a missing results.json instead of passing silently' , async ( t ) => {
187183 const run = await runAction ( t , { kicsExitCode : '0' , inputs : { enable_comments : 'true' } } )
188184 assert . notEqual ( run . code , 0 , 'the scan produced no report, which is not a success' )
189185 } )
0 commit comments