Print error summary in Travis CI (#10474)
This commit is contained in:
parent
ac8f6c57a1
commit
cf323104fc
2 changed files with 28 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ before_script:
|
||||||
- cd ..
|
- cd ..
|
||||||
- export PATH=$(pwd)/bin${PATH:+:$PATH}
|
- export PATH=$(pwd)/bin${PATH:+:$PATH}
|
||||||
- echo PATH:${PATH}
|
- echo PATH:${PATH}
|
||||||
|
- set +e # prevents breaking after_failure
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- nim c koch
|
- nim c koch
|
||||||
|
|
@ -59,3 +60,6 @@ deploy: # https://nim-lang.github.io/Nim
|
||||||
keep-history: false
|
keep-history: false
|
||||||
on:
|
on:
|
||||||
branch: devel
|
branch: devel
|
||||||
|
|
||||||
|
# Extract failed tests
|
||||||
|
after_failure: nim c -r tools/ci_testresults.nim
|
||||||
|
|
|
||||||
24
tools/ci_testresults.nim
Normal file
24
tools/ci_testresults.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
## Print summary of failed tests for CI
|
||||||
|
|
||||||
|
import os, json, sets, strformat
|
||||||
|
|
||||||
|
const skip = toSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
|
||||||
|
|
||||||
|
when isMainModule:
|
||||||
|
for fn in walkFiles("testresults/*.json"):
|
||||||
|
let entries = fn.readFile().parseJson()
|
||||||
|
for j in entries:
|
||||||
|
let res = j["result"].getStr()
|
||||||
|
if skip.contains(res):
|
||||||
|
continue
|
||||||
|
echo fmt """
|
||||||
|
Category: {j["category"].getStr()}
|
||||||
|
Name: {j["name"].getStr()}
|
||||||
|
Action: {j["action"].getStr()}
|
||||||
|
Result: {res}
|
||||||
|
-------- Expected -------
|
||||||
|
{j["expected"].getStr()}
|
||||||
|
--------- Given --------
|
||||||
|
{j["given"].getStr()}
|
||||||
|
-------------------------
|
||||||
|
"""
|
||||||
Loading…
Add table
Add a link
Reference in a new issue