testament: generic N-fold batching: windows CI 37mn=>16m (#14823)

* testament: run CI faster thanks to batching
* move ta_in, tstdin into existing tosproc
* move ta_out,tafalse,texitcode,tstderr into existing tosproc
* joinable osproc
* move tstdout into existing tosproc
* spec: batchable; fix tests
* fixup
This commit is contained in:
Timothee Cour 2020-06-27 07:51:17 -07:00 • committed by GitHub
commit 90808877c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 172 additions and 181 deletions

View file

@ -273,12 +273,14 @@ proc addResult(r: var TResults, test: TTest, target: TTarget,
expected = expected,
given = given)
r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success)
template disp(msg) =
maybeStyledEcho styleDim, fgYellow, msg & " ", styleBright, fgCyan, name
if success == reSuccess:
maybeStyledEcho fgGreen, "PASS: ", fgCyan, alignLeft(name, 60), fgBlue, " (", durationStr, " sec)"
elif success == reDisabled:
maybeStyledEcho styleDim, fgYellow, "SKIP: ", styleBright, fgCyan, name
elif success == reJoined:
maybeStyledEcho styleDim, fgYellow, "JOINED: ", styleBright, fgCyan, name
if test.spec.inCurrentBatch: disp("SKIP:")
else: disp("NOTINBATCH:")
elif success == reJoined: disp("JOINED:")
else:
maybeStyledEcho styleBright, fgRed, failString, fgCyan, name
maybeStyledEcho styleBright, fgCyan, "Test \"", test.name, "\"", " in category \"", test.cat.string, "\""
@ -645,6 +647,15 @@ proc main() =
useColors = false
else:
quit Usage
of "batch":
testamentData0.batchArg = p.val
if p.val != "_":
let s = p.val.split("_")
doAssert s.len == 2, $(p.val, s)
testamentData0.testamentBatch = s[0].parseInt
testamentData0.testamentNumBatch = s[1].parseInt
doAssert testamentData0.testamentNumBatch > 0
doAssert testamentData0.testamentBatch >= 0 and testamentData0.testamentBatch < testamentData0.testamentNumBatch
of "simulate":
simulate = true
of "megatest":
@ -682,6 +693,7 @@ proc main() =
myself &= " " & quoteShell("--targets:" & targetsStr)
myself &= " " & quoteShell("--nim:" & compilerPrefix)
myself &= " --batch:" & testamentData0.batchArg
if skipFrom.len > 0:
myself &= " " & quoteShell("--skipFrom:" & skipFrom)