Skip to content
Snippets Groups Projects
Commit 61af43d0 authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

ci: Describe cause for failure

parent 2149422e
No related branches found
No related tags found
No related merge requests found
...@@ -122,11 +122,18 @@ testPatches cfg = do ...@@ -122,11 +122,18 @@ testPatches cfg = do
print $ resultSummary (configExpectedBrokenPkgs cfg) runResult print $ resultSummary (configExpectedBrokenPkgs cfg) runResult
BSL.writeFile "results.json" $ encode runResult BSL.writeFile "results.json" $ encode runResult
exitWith $ if anyFailures (configExpectedBrokenPkgs cfg) runResult then ExitFailure 1 else ExitSuccess case failedPatches (configExpectedBrokenPkgs cfg) runResult of
[] -> return ()
anyFailures :: BrokenPackages -> RunResult -> Bool badPatches -> do
anyFailures broken (RunResult testedPatches) = print $ "Failed due to unexpected failures in:" PP.<$$> PP.indent 2 (
any failed testedPatches vcat [ prettyPkgVer (patchedPackageName tp) (patchedPackageVersion tp)
| tp <- badPatches
])
exitWith $ ExitFailure 1
failedPatches :: BrokenPackages -> RunResult -> [TestedPatch]
failedPatches broken (RunResult testedPatches) =
filter failed testedPatches
where where
failed tp = failed tp =
patchFailed tp /= failureExpected broken (patchedPackageName tp) patchFailed tp /= failureExpected broken (patchedPackageName tp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment