12d1f4f385
This check was added in98fe4bd8f1
, to check whether dm_task_deferred_remove could be removed, and to conditionally set the corresponding build-tags. Now that the devicemapper graphdriver has been removed indc11d2a2d8
, we no longer need this. This patch: - removes uses of the (no longer used) `libdm`, `dlsym_deferred_remove`, and `libdm_no_deferred_remove` build-tags. - removes the `add_buildtag` utility, which is now unused. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
52 lines
1.6 KiB
Bash
Executable file
52 lines
1.6 KiB
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 journald')
|
|
TESTFLAGS+=" -test.timeout=${TIMEOUT:-5m}"
|
|
TESTDIRS="${TESTDIRS:-./...}"
|
|
exclude_paths='/vendor/|/integration'
|
|
pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")
|
|
|
|
base_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings -v "/libnetwork" || :)
|
|
libnetwork_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings "/libnetwork" || :)
|
|
|
|
echo "${libnetwork_pkg_list}" | grep --fixed-strings "libnetwork/drivers/bridge" \
|
|
&& if ! type docker-proxy; then
|
|
hack/make.sh binary-proxy install-proxy
|
|
fi
|
|
|
|
mkdir -p bundles
|
|
|
|
if [ -n "${base_pkg_list}" ]; then
|
|
gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- \
|
|
"${BUILDFLAGS[@]}" \
|
|
-cover \
|
|
-coverprofile=bundles/coverage.out \
|
|
-covermode=atomic \
|
|
${TESTFLAGS} \
|
|
${base_pkg_list}
|
|
fi
|
|
if [ -n "${libnetwork_pkg_list}" ]; then
|
|
# libnetwork tests invoke iptables, and cannot be run in parallel. Execute
|
|
# tests within /libnetwork with '-p=1' to run them sequentially. See
|
|
# https://github.com/moby/moby/issues/42458#issuecomment-873216754 for details.
|
|
gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report-libnetwork.json --junitfile=bundles/junit-report-libnetwork.xml -- \
|
|
"${BUILDFLAGS[@]}" \
|
|
-cover \
|
|
-coverprofile=bundles/coverage-libnetwork.out \
|
|
-covermode=atomic \
|
|
-p=1 \
|
|
${TESTFLAGS} \
|
|
${libnetwork_pkg_list}
|
|
fi
|