1
0

gotestfmt 792 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. #
  3. # wraps `gotestfmt`, hiding output from successful packages unless
  4. # all tests passed.
  5. set -o pipefail
  6. set -e
  7. # tee the test results to a log, whilst also piping them into gotestfmt,
  8. # telling it to hide successful results, so that we can clearly see
  9. # unsuccessful results.
  10. tee complement.log | gotestfmt -hide successful-packages
  11. # gotestfmt will exit non-zero if there were any failures, so if we got to this
  12. # point, we must have had a successful result.
  13. echo "All tests successful; showing all test results"
  14. # Pipe the test results back through gotestfmt, showing all results.
  15. # The log file consists of JSON lines giving the test results, interspersed
  16. # with regular stdout lines (including reports of downloaded packages).
  17. grep '^{"Time":' complement.log | gotestfmt