From 0620990307aaf8ada706ffb6c5dc0628c92d84af Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 13 Sep 2019 16:01:54 +0200 Subject: [PATCH] hack/test/unit: fix custom TESTFLAGS not working The `-test.timeout=5m` was glued directly after the current `TESTFLAGS`, causing them to be non-functional; Before: make TESTDEBUG=1 TESTDIRS='github.com/docker/docker/pkg/filenotify' TESTFLAGS='-test.run TestPollerEvent' test-unit + mkdir -p bundles + gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- -tags 'netgo seccomp libdm_no_deferred_remove' -cover -coverprofile=bundles/profile.out -covermode=atomic -test.run TestPollerEvent-test.timeout=5m github.com/docker/docker/pkg/filenotify testing: warning: no tests to run ok github.com/docker/docker/pkg/filenotify 0.003s coverage: 0.0% of statements [no tests to run] DONE 0 tests in 0.298s After: make TESTDEBUG=1 TESTDIRS='github.com/docker/docker/pkg/filenotify' TESTFLAGS='-test.run TestPollerEvent' test-unit + mkdir -p bundles + gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- -tags 'netgo seccomp libdm_no_deferred_remove' -cover -coverprofile=bundles/profile.out -covermode=atomic -test.run TestPollerEvent -test.timeout=5m github.com/docker/docker/pkg/filenotify ok github.com/docker/docker/pkg/filenotify 0.608s coverage: 44.7% of statements DONE 1 tests in 0.922s This was introduced in 42f0a0db75a921145c7f519f7b550e1392890da2 Signed-off-by: Sebastiaan van Stijn --- hack/test/unit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/test/unit b/hack/test/unit index 1aea06c54b..a47a93935f 100755 --- a/hack/test/unit +++ b/hack/test/unit @@ -13,7 +13,7 @@ set -eu -o pipefail BUILDFLAGS=( -tags 'netgo seccomp libdm_no_deferred_remove' ) -TESTFLAGS+="-test.timeout=${TIMEOUT:-5m}" +TESTFLAGS+=" -test.timeout=${TIMEOUT:-5m}" TESTDIRS="${TESTDIRS:-./...}" exclude_paths='/vendor/|/integration' pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")