mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
4b981436fe
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
33 lines
910 B
Bash
Executable file
33 lines
910 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# Run unit tests and create report
|
|
#
|
|
# TESTFLAGS - add additional test flags. Ex:
|
|
#
|
|
# TESTFLAGS='-v -run TestBuild' hack/test/unit
|
|
#
|
|
# TESTDIRS - run tests for specified packages. Ex:
|
|
#
|
|
# TESTDIRS='./pkg/term' hack/test/unit
|
|
#
|
|
set -eux -o pipefail
|
|
|
|
BUILDFLAGS=(-tags 'netgo seccomp libdm_no_deferred_remove')
|
|
TESTFLAGS+=" -test.timeout=${TIMEOUT:-5m}"
|
|
TESTDIRS="${TESTDIRS:-./...}"
|
|
exclude_paths='/vendor/|/integration'
|
|
pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")
|
|
|
|
echo "${pkg_list}" | grep --fixed-strings "libnetwork/drivers/bridge" \
|
|
&& if ! type docker-proxy; then
|
|
hack/make.sh binary-proxy install-proxy
|
|
fi
|
|
|
|
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}
|