From ac70b00061fed3aa6285ef2c0794f01805349c86 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Fri, 20 Dec 2019 16:14:42 +0100 Subject: [PATCH 1/2] Remove buffering of output Signed-off-by: David Gageot --- hack/gotest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/gotest.sh b/hack/gotest.sh index d6854dcac38..ba601f4c00d 100755 --- a/hack/gotest.sh +++ b/hack/gotest.sh @@ -35,7 +35,7 @@ else fi echo "go test $@" -go test -json $@ | tee $LOG | jq --unbuffered -j "${JQ_FILTER}" | awk -v FAIL="${RED}FAIL${RESET}" '{ gsub("FAIL", FAIL, $0); print $0 }' +go test -json $@ | tee $LOG | jq --unbuffered -j "${JQ_FILTER}" | sed ''/FAIL/s//`printf "${RED}FAIL${RESET}"`/'' RESULT=${PIPESTATUS[0]} if [ $RESULT != 0 ]; then From 5429e963b3d8e85eb9f217a1a10e26a5e1cde464 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Fri, 20 Dec 2019 16:17:37 +0100 Subject: [PATCH 2/2] =?UTF-8?q?What=E2=80=99s=20your=20favourite=20colour?= =?UTF-8?q?=3F=20Blue!=20No!=20yellowww!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: David Gageot --- hack/gotest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/gotest.sh b/hack/gotest.sh index ba601f4c00d..9cd286586c1 100755 --- a/hack/gotest.sh +++ b/hack/gotest.sh @@ -22,7 +22,7 @@ set -e # - It lists the 20 slowest tests RED='\033[0;31m' -BLUE='\033[0;33m' +YELLOW='\033[0;33m' RESET='\033[0m' LOG=$(mktemp -t tests.json.XXXXXX) @@ -45,7 +45,7 @@ if [ $RESULT != 0 ]; then cat $LOG | jq -r "select(.Action==\"fail\" and has(\"Test\")) | \"\(.Package|ltrimstr(\"${MODULE}/\"))/\(.Test)\"" fi -echo -e "\n${BLUE}=== Slow Tests ===${RESET}" +echo -e "\n${YELLOW}=== Slow Tests ===${RESET}" cat $LOG | jq -rs 'map(select(.Elapsed > 0 and has("Test"))) | sort_by(.Elapsed) | reverse | map("\(.Elapsed)\t\(.Test)")[]' | head -n20 exit $RESULT