Use runtime instead of datetime for test output.

This commit is contained in:
Matt Clay
2018-08-23 10:23:19 -07:00
parent 34b36d5178
commit 31a5b874a1
3 changed files with 13 additions and 2 deletions

10
test/utils/shippable/timing.py Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env python3
import sys
import time
start = time.time()
for line in sys.stdin:
seconds = time.time() - start
sys.stdout.write('%02d:%02d %s' % (seconds // 60, seconds % 60, line))

View File

@@ -1,5 +1,5 @@
#!/bin/bash -eux
#!/bin/bash -eu
set -o pipefail
"$@" 2>&1 | gawk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
"$@" 2>&1 | "$(dirname "$0")/timing.py"