From: Arnaud Rebillout Date: Mon, 16 Sep 2019 06:27:36 +0000 (+0700) Subject: Dont use gotestsum in hack/test/unit X-Git-Tag: archive/raspbian/18.09.9+dfsg1-5+rpi1~1^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=50bdc9d24e13023f73877b603187f0e616f4e094;p=docker.io.git Dont use gotestsum in hack/test/unit gotestsum is not yet in Debian, let's just stick to 'go test' for now. As soon as gotestsum is packaged for Debian (see #940225), we can drop this patch, and add gotestsum as a build dependency. This is a partial revert of the commit: https://github.com/docker/docker-ce/commit/bef34d1 Signed-off-by: Arnaud Rebillout Origin: vendor, Debian Forwarded: not-needed, Debian-specific Gbp-Pq: Name debian-dont-use-gotestsum-in-hack-test-unit.patch --- diff --git a/engine/hack/test/unit b/engine/hack/test/unit index 1aea06c5..4d679692 100755 --- a/engine/hack/test/unit +++ b/engine/hack/test/unit @@ -13,16 +13,21 @@ 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)") -mkdir -p bundles -gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- \ - "${BUILDFLAGS[@]}" \ - -cover \ - -coverprofile=bundles/profile.out \ - -covermode=atomic \ - ${TESTFLAGS} \ - ${pkg_list} +for pkg in $pkg_list; do + go test "${BUILDFLAGS[@]}" \ + -cover \ + -coverprofile=profile.out \ + -covermode=atomic \ + ${TESTFLAGS} \ + "${pkg}" + + if test -f profile.out; then + cat profile.out >> coverage.txt + rm profile.out + fi +done