made 'testament all' run in parallel
This commit is contained in:
parent
a5f1abc5ca
commit
fa02ffaeba
3 changed files with 15 additions and 13 deletions
|
|
@ -70,5 +70,6 @@ proc open*() =
|
||||||
thisCommit = getCommit()
|
thisCommit = getCommit()
|
||||||
|
|
||||||
proc close*() =
|
proc close*() =
|
||||||
|
if currentCategory.len > 0:
|
||||||
results.writeLine("]")
|
results.writeLine("]")
|
||||||
close(results)
|
close(results)
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ proc allTestResults(): AllTests =
|
||||||
else:
|
else:
|
||||||
for elem in data:
|
for elem in data:
|
||||||
result.data.add elem
|
result.data.add elem
|
||||||
let state = elem["result"]
|
let state = elem["result"].str
|
||||||
if state.contains("reSuccess"): inc result.successCount
|
if state.contains("reSuccess"): inc result.successCount
|
||||||
elif state.contains("reIgnored"): inc result.ignoredCount
|
elif state.contains("reIgnored"): inc result.ignoredCount
|
||||||
|
|
||||||
|
|
@ -120,7 +120,7 @@ proc generateTestRunTabContentPartial(outfile: File, allResults: AllTests, testR
|
||||||
firstTabActiveClass = if firstRow: " in active"
|
firstTabActiveClass = if firstRow: " in active"
|
||||||
else: ""
|
else: ""
|
||||||
commitId = htmlQuote testRunRow["commit"].str
|
commitId = htmlQuote testRunRow["commit"].str
|
||||||
hash = htmlQuote(testRunRow["hash"].str)
|
hash = htmlQuote(testRunRow["commit"].str)
|
||||||
branch = htmlQuote(testRunRow["branch"].str)
|
branch = htmlQuote(testRunRow["branch"].str)
|
||||||
machineId = htmlQuote testRunRow["machine"].str
|
machineId = htmlQuote testRunRow["machine"].str
|
||||||
machineName = htmlQuote(testRunRow["machine"].str)
|
machineName = htmlQuote(testRunRow["machine"].str)
|
||||||
|
|
@ -141,15 +141,12 @@ proc generateTestRunTabContentPartial(outfile: File, allResults: AllTests, testR
|
||||||
proc generateTestRunsHtmlPartial(outfile: File, allResults: AllTests, onlyFailing = false) =
|
proc generateTestRunsHtmlPartial(outfile: File, allResults: AllTests, onlyFailing = false) =
|
||||||
# Iterating the results twice, get entire result set in one go
|
# Iterating the results twice, get entire result set in one go
|
||||||
outfile.generateHtmlTabListBegin()
|
outfile.generateHtmlTabListBegin()
|
||||||
var firstRow = true
|
if allResults.data.len > 0:
|
||||||
for testRunRow in allResults.data:
|
generateTestRunTabListItemPartial(outfile, allResults.data[0], true)
|
||||||
generateTestRunTabListItemPartial(outfile, testRunRow, firstRow)
|
|
||||||
if firstRow:
|
|
||||||
firstRow = false
|
|
||||||
outfile.generateHtmlTabListEnd()
|
outfile.generateHtmlTabListEnd()
|
||||||
|
|
||||||
outfile.generateHtmlTabContentsBegin()
|
outfile.generateHtmlTabContentsBegin()
|
||||||
firstRow = true
|
var firstRow = true
|
||||||
for testRunRow in allResults.data:
|
for testRunRow in allResults.data:
|
||||||
generateTestRunTabContentPartial(outfile, allResults, testRunRow, onlyFailing, firstRow)
|
generateTestRunTabContentPartial(outfile, allResults, testRunRow, onlyFailing, firstRow)
|
||||||
if firstRow:
|
if firstRow:
|
||||||
|
|
|
||||||
|
|
@ -459,13 +459,17 @@ proc main() =
|
||||||
case action
|
case action
|
||||||
of "all":
|
of "all":
|
||||||
let testsDir = "tests" & DirSep
|
let testsDir = "tests" & DirSep
|
||||||
|
let myself = quoteShell(findExe("tests" / "testament" / "tester"))
|
||||||
|
var cmds: seq[string] = @[]
|
||||||
|
let rest = if p.cmdLineRest.string.len > 0: " " & p.cmdLineRest.string else: ""
|
||||||
for kind, dir in walkDir(testsDir):
|
for kind, dir in walkDir(testsDir):
|
||||||
assert testsDir.startsWith(testsDir)
|
assert testsDir.startsWith(testsDir)
|
||||||
let cat = dir[testsDir.len .. ^1]
|
let cat = dir[testsDir.len .. ^1]
|
||||||
if kind == pcDir and cat notin ["testament", "testdata", "nimcache"]:
|
if kind == pcDir and cat notin ["testament", "testdata", "nimcache"]:
|
||||||
processCategory(r, Category(cat), p.cmdLineRest.string)
|
cmds.add(myself & " cat " & cat & rest)
|
||||||
for a in AdditionalCategories:
|
for cat in AdditionalCategories:
|
||||||
processCategory(r, Category(a), p.cmdLineRest.string)
|
cmds.add(myself & " cat " & cat & rest)
|
||||||
|
quit osproc.execProcesses(cmds, {poEchoCmd, poStdErrToStdOut, poUsePath, poParentStreams})
|
||||||
of "c", "cat", "category":
|
of "c", "cat", "category":
|
||||||
var cat = Category(p.key)
|
var cat = Category(p.key)
|
||||||
p.next
|
p.next
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue