Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Commit

Permalink
Use updated test method
Browse files Browse the repository at this point in the history
  • Loading branch information
skilly-lily committed Jan 7, 2021
1 parent 0205b1a commit deece4f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/App/Fossa/Container/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ testInner apiOpts outputType override image = do
issues <- waitForIssues apiOpts revision
logSticky ""

if null $ issuesIssues issues
then logInfo "Test passed! 0 issues found"
else do
case outputType of
TestOutputPretty -> logError $ pretty issues
TestOutputJson -> logStdout . pretty . decodeUtf8 . Aeson.encode $ issues
sendIO exitFailure
case issuesCount issues of
0 -> logInfo "Test passed! 0 issues found"
n -> do
logError $ "Test failed. Number of issues found: " <> pretty n
if null (issuesIssues issues)
then logError "Check webapp for more details, or use a full-access API key (currently using a push-only API key)"
else do
case outputType of
TestOutputPretty -> logError $ pretty issues
TestOutputJson -> logStdout . pretty . decodeUtf8 . Aeson.encode $ issues
sendIO exitFailure

0 comments on commit deece4f

Please sign in to comment.