Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
head.hackage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
head.hackage
Commits
30fb84aa
Commit
30fb84aa
authored
5 years ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
Track broken package on a per-unit basis
parent
47654ece
Branches
wip/separate-logs
No related tags found
No related merge requests found
Pipeline
#12156
failed
5 years ago
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci/TestPatches.hs
+19
-28
19 additions, 28 deletions
ci/TestPatches.hs
with
19 additions
and
28 deletions
ci/TestPatches.hs
+
19
−
28
View file @
30fb84aa
...
...
@@ -123,14 +123,10 @@ testPatches cfg = do
print
$
resultSummary
(
configExpectedBrokenPkgs
cfg
)
runResult
BSL
.
writeFile
"results.json"
.
encode
=<<
writeLogs
"logs"
runResult
case
failedPatches
(
configExpectedBrokenPkgs
cfg
)
runResult
of
[]
->
return
()
badPatches
->
do
print
$
"Failed due to unexpected failures in:"
PP
.<$$>
PP
.
indent
2
(
vcat
[
prettyPkgVer
(
patchedPackageName
tp
)
(
patchedPackageVersion
tp
)
|
tp
<-
badPatches
])
exitWith
$
ExitFailure
1
let
failedBuilds
=
failedPatches
runResult
planningFailures
=
planningErrors
runResult
okay
=
null
failedBuilds
&&
null
planningFailures
unless
okay
$
exitWith
$
ExitFailure
1
writeLogs
::
FilePath
->
RunResult
LogOutput
->
IO
(
RunResult
()
)
writeLogs
logDir
runResult
=
do
...
...
@@ -149,26 +145,28 @@ writeLogs logDir runResult = do
writeLog
(
UnitId
unitId
,
LogOutput
log
)
=
TIO
.
writeFile
logPath
log
where
logPath
=
logDir
</>
T
.
unpack
unitId
failed
Patche
s
::
BrokenPackages
->
RunResult
log
->
[
TestedPatch
log
]
failedPatches
broken
(
RunResult
testedPatches
)
=
filter
failed
testedPatche
s
failed
Unit
s
::
BrokenPackages
->
RunResult
log
->
M
.
Map
UnitId
(
BuildInfo
,
BuildResult
log
)
failedUnits
broken
=
M
.
filter
didFail
.
runResultUnit
s
where
failed
tp
=
patchFailed
tp
/=
failureExpected
broken
(
patchedPackageName
tp
)
patchFailed
::
TestedPatch
log
->
Bool
patchFailed
tp
=
case
patchedPackageResult
tp
of
PackagePlanningFailed
_
->
True
PackageResult
False
_
->
True
_
->
False
didFail
(
buildInfo
,
result
)
=
case
result
of
BuildFailed
_
->
not
$
failureExpected
broken
(
pkgName
buildInfo
)
_
->
False
planningErrors
::
RunResult
log
->
[(
PkgName
,
Ver
)]
planningErrors
runResult
=
[
(
patchedPackageName
tpatch
,
patchedPackageVersion
tpatch
)
|
tpatch
<-
testedPatches
runResult
,
PackagePlanningFailed
_
<-
pure
$
patchedPackageResult
tpatch
]
resultSummary
::
forall
log
.
BrokenPackages
->
RunResult
log
->
Doc
resultSummary
broken
runResult
=
vcat
[
"Total units built:"
<+>
pshow
(
length
allUnits
)
,
""
,
pshow
(
length
planningErrors
)
<+>
"had no valid install plan:"
,
PP
.
indent
4
$
vcat
$
map
(
uncurry
prettyPkgVer
)
planningErrors
,
PP
.
indent
4
$
vcat
$
map
(
uncurry
prettyPkgVer
)
(
planningErrors
runResult
)
,
""
,
pshow
(
length
failedUnits
)
<+>
"units failed to build:"
,
PP
.
indent
4
$
vcat
...
...
@@ -182,13 +180,6 @@ resultSummary broken runResult = vcat
,
pshow
(
length
failedDependsUnits
)
<+>
"units failed to build due to unbuildable dependencies."
]
where
planningErrors
::
[(
PkgName
,
Ver
)]
planningErrors
=
[
(
patchedPackageName
tpatch
,
patchedPackageVersion
tpatch
)
|
tpatch
<-
testedPatches
runResult
,
PackagePlanningFailed
_
<-
pure
$
patchedPackageResult
tpatch
]
allUnits
=
runResultUnits
runResult
failedUnits
::
M
.
Map
UnitId
(
BuildInfo
,
BuildResult
log
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment