From 3a9ba545bc4a31b12b3c9b4572b3bb09022ed1e5 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 14 Jun 2017 10:55:11 -0700 Subject: [PATCH] Speed up testing with coverage By running a 'go test -i' on all the packages first the overall runtime is significantly decreased. Signed-off-by: Daniel Nephin --- scripts/test/unit-with-coverage | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/test/unit-with-coverage b/scripts/test/unit-with-coverage index 8c599b43ff..cd1ead8477 100755 --- a/scripts/test/unit-with-coverage +++ b/scripts/test/unit-with-coverage @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -eu -o pipefail +# install test dependencies once before running tests for each package. This +# reduces the runtime from 200s down to 23s +go test -i $@ + for pkg in $@; do ./scripts/test/unit \ -cover \