Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-test
Commits
c4443c4f
Verified
Commit
c4443c4f
authored
Sep 17, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify human-readable output: add messages for crashed (lost) tests and non-zero exit code
parent
a463aac0
Pipeline
#29765
passed with stage
in 1 minute and 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
cleantest.icl
cleantest.icl
+21
-21
No files found.
cleantest.icl
View file @
c4443c4f
...
...
@@ -24,7 +24,7 @@ import System.Options
import
System
.
Process
import
Testing
.
Options
import
Testing
.
TestEvents
from
Text
import
<+,
class
Text
(
join
,
lpad
,
replaceSubString
,
split
,
trim
,
concat
),
instance
Text
String
from
Text
import
<+,
class
Text
(
join
,
lpad
,
ltrim
,
replaceSubString
,
split
,
trim
,
concat
),
instance
Text
String
import
Text
.
GenJSON
import
Text
.
GenPrint
import
Text
.
Language
...
...
@@ -236,7 +236,9 @@ where
|
continue
=:(
Ok
False
)
#
results
=
map
(
fromJSON
o
fromString
)
$
filter
((<>)
""
)
output
.
lines
#
events
=
map
fromJust
results
=
return
(
collectEvents
events
).
event
[
ee
\\
EndEvent
ee
<-
events
]
r
io
w
#
(
lost
,
ee
)
=
collectEvents
events
#
io
=
foldl
(
flip
emit
)
io
lost
=
return
ee
.
event
[
ee
\\
EndEvent
ee
<-
events
++
lost
]
r
io
w
// Check if child has terminated
#
(
t
,
w
)
=
checkProcess
h
w
|
isError
t
...
...
@@ -271,45 +273,42 @@ where
|
otherwise
=
s
%
(
0
,
n
-4
)
+++
"..."
=
return
event
[]
r
io
w
#
events
=
map
fromJust
results
#
ee
=
collectEvents
events
#
io
=
emit
(
EndEvent
ee
)
io
#
(
lost
,
ee
)
=
collectEvents
events
#
events
=
events
++
lost
#
io
=
foldl
(
flip
emit
)
io
lost
|
fromJust
rcode
<>
0
#
event
=
Failed
Nothing
|
ee
.
event
=:(
Failed
(
Just
(
FailedChildren
_)))
// We already have a FailedChildren message; no need for another about the exit code
=
return
event
[
ee
\\
EndEvent
ee
<-
events
]
r
io
w
#
io
=
emit
(
EndEvent
{
name
=
r
.
TestRun
.
name
,
location
=
Nothing
,
event
=
event
,
message
=
"Child process exited with "
<+
fromJust
rcode
})
io
=
return
event
[
ee
\\
EndEvent
ee
<-
events
]
r
io
w
#
msg
=
"Child process exited with "
<+
fromJust
rcode
<+
"."
#
ee
&
message
=
ltrim
(
ee
.
message
+++
"
\n
"
+++
msg
)
#
ee
&
event
=
case
ee
.
event
of
Passed
->
Failed
(
Just
(
CustomFailReason
msg
))
_
->
ee
.
event
#
io
=
emit
(
EndEvent
ee
)
io
=
return
ee
.
event
[
ee
\\
EndEvent
ee
<-
events
]
r
io
w
#
io
=
emit
(
EndEvent
ee
)
io
=
return
ee
.
event
[
ee
\\
EndEvent
ee
<-
events
]
r
io
w
#
w
=
snd
$
fclose
io
w
=
redirect
output
h
pio
r
w
where
collectEvents
::
[
TestEvent
]
->
EndEvent
collectEvents
::
[
TestEvent
]
->
([
TestEvent
],
EndEvent
)
collectEvents
tes
=
(
[
EndEvent
{
name
=
se
.
StartEvent
.
name
,
location
=
se
.
StartEvent
.
location
,
event
=
Failed
(
Just
Crashed
),
message
=
""
}
\\
se
<-
lost
],
{
name
=
r
.
TestRun
.
name
,
location
=
Nothing
,
event
=
if
(
isEmpty
failed
&&
isEmpty
lost
)
Passed
(
Failed
$
Just
$
FailedChildren
$
[(
name
,
fr
)
\\
EndEvent
{
name
,
event
=
Failed
fr
}
<-
failed
]
++
[(
l
,
Just
Crashed
)
\\
l
<-
lost
])
[(
l
.
StartEvent
.
name
,
Just
Crashed
)
\\
l
<-
lost
])
,
message
=
pluralisen
English
(
length
passed
)
"test"
<+
" passed, "
<+
pluralisen
English
(
length
failed
)
"test"
<+
" failed, "
<+
pluralisen
English
(
length
skipped
)
"test"
<+
" skipped and "
<+
pluralisen
English
(
length
lost
)
"test"
<+
" lost."
}
}
)
where
passed
=
filter
(\
te
->
te
=:(
EndEvent
{
event
=
Passed
}))
tes
failed
=
filter
(\
te
->
te
=:(
EndEvent
{
event
=
Failed
_}))
tes
skipped
=
filter
(\
te
->
te
=:(
EndEvent
{
event
=
Skipped
}))
tes
lost
=
[
se
.
StartEvent
.
name
\\
StartEvent
se
<-
tes
lost
=
[
se
\\
StartEvent
se
<-
tes
|
not
$
any
(\(
EndEvent
ee
)
->
se
.
StartEvent
.
name
==
ee
.
EndEvent
.
name
)
$
passed
++
failed
++
skipped
]
...
...
@@ -369,6 +368,7 @@ where
join
"
\n
- "
(
map
(
replaceSubString
"
\n
"
"
\n
"
o
printCE
)
ces
)
FailedChildren
fcs
->
"
\n
Children tests failed: "
+++
join
", "
(
map
fst
fcs
)
Crashed
->
"
\n
Crashed"
CustomFailReason
r
->
"
\n
"
+++
r
Failed
Nothing
->
"
\n
"
+++
ee
.
message
_
->
""
where
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment