diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2019-01-28 16:32:30 +0000 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-01-28 17:32:30 +0100 |
commit | cf323104fc8b4b40b2a4cb1f0b405a22dc134bde (patch) | |
tree | 342596c81f9e8421c31204fb4de499e478fb57ab | |
parent | ac8f6c57a1eb915e9b25ea52bf868c8b89b30c04 (diff) | |
download | Nim-cf323104fc8b4b40b2a4cb1f0b405a22dc134bde.tar.gz |
Print error summary in Travis CI (#10474)
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | tools/ci_testresults.nim | 24 |
2 files changed, 28 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index ea5d54ead..293ad6bb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ before_script: - cd .. - export PATH=$(pwd)/bin${PATH:+:$PATH} - echo PATH:${PATH} + - set +e # prevents breaking after_failure script: - nim c koch @@ -59,3 +60,6 @@ deploy: # https://nim-lang.github.io/Nim keep-history: false on: branch: devel + +# Extract failed tests +after_failure: nim c -r tools/ci_testresults.nim diff --git a/tools/ci_testresults.nim b/tools/ci_testresults.nim new file mode 100644 index 000000000..3201606d7 --- /dev/null +++ b/tools/ci_testresults.nim @@ -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()} +------------------------- +""" |