Browse code

Update unit tests for api module

Signed-off-by: Derek McGowan <derek@mcg.dev>

Derek McGowan authored on 2025/07/02 14:33:05
Showing 1 changed files
... ...
@@ -18,7 +18,8 @@ TESTDIRS="${TESTDIRS:-./...}"
18 18
 exclude_paths='/vendor/|/integration'
19 19
 pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")
20 20
 
21
-base_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings -v "/libnetwork" || :)
21
+base_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings -v "/libnetwork" | grep --fixed-strings -v "/docker/docker/api" || :)
22
+api_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings "docker/docker/api" | sed 's/docker\/docker/moby\/moby/' || :)
22 23
 libnetwork_pkg_list=$(echo "${pkg_list}" | grep --fixed-strings "/libnetwork" || :)
23 24
 
24 25
 echo "${libnetwork_pkg_list}" | grep --fixed-strings "libnetwork/drivers/bridge" \
... ...
@@ -37,6 +38,19 @@ if [ -n "${base_pkg_list}" ]; then
37 37
 		${TESTFLAGS} \
38 38
 		${base_pkg_list}
39 39
 fi
40
+
41
+if [ -n "${api_pkg_list}" ]; then
42
+	cd api
43
+	GO111MODULE=on gotestsum --format=standard-quiet --jsonfile=../bundles/go-test-report-api.json --junitfile=../bundles/junit-report-api.xml -- \
44
+		"${BUILDFLAGS[@]}" \
45
+		-cover \
46
+		-coverprofile=../bundles/coverage-api.out \
47
+		-covermode=atomic \
48
+		${TESTFLAGS} \
49
+		${api_pkg_list}
50
+	cd ..
51
+fi
52
+
40 53
 if [ -n "${libnetwork_pkg_list}" ]; then
41 54
 	rerun_flaky=1
42 55