ci_testresults.nim 621 B

12345678910111213141516171819202122232425
  1. ## Print summary of failed tests for CI
  2. import os, json, sets, strformat
  3. const skip = toHashSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
  4. when isMainModule:
  5. for fn in walkFiles("testresults/*.json"):
  6. let entries = fn.readFile().parseJson()
  7. for j in entries:
  8. let res = j["result"].getStr()
  9. if skip.contains(res):
  10. continue
  11. echo fmt """
  12. Category: {j["category"].getStr()}
  13. Name: {j["name"].getStr()}
  14. Action: {j["action"].getStr()}
  15. Result: {res}
  16. -------- Expected -------
  17. {j["expected"].getStr()}
  18. --------- Given --------
  19. {j["given"].getStr()}
  20. -------------------------
  21. """