Update unit tests for api module

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2025-07-01 22:33:05 -07:00
parent 0971099c5f
commit 7e708a5416

View File

@@ -18,7 +18,8 @@ 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" || :)
base_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings -v "/libnetwork" | grep --fixed-strings -v "/docker/docker/api" || :)
api_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings "docker/docker/api" | sed 's/docker\/docker/moby\/moby/' || :)
libnetwork_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings "/libnetwork" || :)
echo "${libnetwork_pkg_list}" | grep --fixed-strings "libnetwork/drivers/bridge" \
@@ -37,6 +38,19 @@ if [ -n "${base_pkg_list}" ]; then
${TESTFLAGS} \
${base_pkg_list}
fi
if [ -n "${api_pkg_list}" ]; then
cd api
GO111MODULE=on gotestsum --format=standard-quiet --jsonfile=../bundles/go-test-report-api.json --junitfile=../bundles/junit-report-api.xml -- \
"${BUILDFLAGS[@]}" \
-cover \
-coverprofile=../bundles/coverage-api.out \
-covermode=atomic \
${TESTFLAGS} \
${api_pkg_list}
cd ..
fi
if [ -n "${libnetwork_pkg_list}" ]; then
rerun_flaky=1