Verified Commit 977b87e6 authored by Camil Staps's avatar Camil Staps 🚀

Add time field to EndEvent records

parent f72811c4
Pipeline #47417 passed with stages
in 10 minutes and 28 seconds
......@@ -20,8 +20,8 @@ compileTestModule (path,name)
>-| get cpmExecutable
>>- \cpm -> runWithOutput cpm [prjPath] ?None //Build the test
@ \(c,o) -> if (passed c o)
{name = testName, location= ?Just {moduleName= ?Just name}, event = Passed, message = join "" o}
{name = testName, location= ?Just {moduleName= ?Just name}, event = (Failed ?None), message = join "" o}
{name = testName, location= ?Just {moduleName= ?Just name}, event = Passed, message = join "" o, time = ?None}
{name = testName, location= ?Just {moduleName= ?Just name}, event = (Failed ?None), message = join "" o, time = ?None}
where
testName = "Compile: " +++ name
iclPath = cleanFilePath (path,name,Icl)
......@@ -52,8 +52,8 @@ where
= [res \\ ?Just res <- map (fromJSON o fromString) lines]
where
//If we can't parse the output, We'll treat it as a single simple test executable
fallback 0 _ = [{name=name,location= ?Just {moduleName= ?Just name},event=Passed,message="Execution returned 0"}]
fallback _ output = [{name=name,location= ?Just {moduleName= ?Just name},event=Failed ?None,message=output}]
fallback 0 _ = [{name=name,location= ?Just {moduleName= ?Just name},event=Passed,message="Execution returned 0",time= ?None}]
fallback _ output = [{name=name,location= ?Just {moduleName= ?Just name},event=Failed ?None,message=output,time= ?None}]
runWithOutput :: FilePath [String] (?FilePath) -> Task (Int,[String])
runWithOutput prog args dir = withShared ([], []) \out->withShared [] \stdin->
......
......@@ -128,10 +128,10 @@ where
with event = StartEvent {StartEvent | name=name,location= ?None}
FinishTest name True _
-> (?None, Ok (local_queue,{status & testEvents=[event:status.testEvents]},stop))
with event = EndEvent {name=name,location= ?None,event=Passed,message=""}
with event = EndEvent {name=name,location= ?None,event=Passed,message="",time= ?None}
FinishTest name False reason
-> (?None, Ok (local_queue,{status & testEvents=[event:status.testEvents]},stop))
with event = EndEvent {name=name,location= ?None,event=Failed (?Just $ CustomFailReason reason),message=""}
with event = EndEvent {name=name,location= ?None,event=Failed (?Just $ CustomFailReason reason),message="",time= ?None}
Screenshot filename png
-> (?None, Ok (local_queue,{status & screenshots='Map'.put filename (base64Decode png) status.screenshots},False))
OK
......@@ -240,6 +240,7 @@ where
, location = location
, event = Failed (?Just Crashed)
, message = ""
, time = ?None
}
runTestSuiteWithCLI :: ![TestedTask] !*World -> *World
......
......@@ -187,7 +187,7 @@ where
Passed = "PASSED"
Failed _ = "FAILED"
Skipped = "SKIPPED"
# console = fwrites (toString (toJSON (EndEvent {EndEvent|name=name,location= ?None,event=result,message=message})) +++ "\n") console
# console = fwrites (toString (toJSON (EndEvent {EndEvent|name=name,location= ?None,event=result,message=message,time= ?None})) +++ "\n") console
= ([(name,result):results],(console,world))
skipTest name {runs,skip}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment