Przeglądaj źródła

hack: explicit bundles for integration-cli prequisites

no longer load hide critical code such as in .integration-daemon-{start,stop},
if this step failed, it will had logged the corresponding module before:

---> Making bundle: .integration-daemon-start (in bundles/1.7.0-dev/daemon-start)

which is nicer to debug.

This will make it also easier to execute a single tests in an interactive shell.

$ make shell
docker> . hack/make.sh binary .integration-daemon-start .integration-daemon-setup
docker> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED STATUS              PORTS               NAMES
docker> go test github.com/docker/docker/integration-cli

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Jörg Thalheim 10 lat temu
rodzic
commit
2b4facdf2e

+ 5 - 0
hack/make/.integration-daemon-setup

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+bundle .ensure-emptyfs
+bundle .ensure-frozen-images
+bundle .ensure-httpserver

+ 2 - 1
hack/make/.integration-daemon-start

@@ -49,7 +49,8 @@ if [ -z "$DOCKER_TEST_HOST" ]; then
 		$storage_params \
 			&> "$DEST/docker.log"
 	) &
-	trap "source '${MAKEDIR}/.integration-daemon-stop'" EXIT # make sure that if the script exits unexpectedly, we stop this daemon we just started
+	# make sure that if the script exits unexpectedly, we stop this daemon we just started
+	trap 'bundle .integration-daemon-stop' EXIT
 else
 	export DOCKER_HOST="$DOCKER_TEST_HOST"
 fi

+ 2 - 3
hack/make/build-deb

@@ -4,8 +4,7 @@ set -e
 # subshell so that we can export PATH and TZ without breaking other things
 (
 	export TZ=UTC # make sure our "date" variables are UTC-based
-
-	source "${MAKEDIR}/.integration-daemon-start"
+	bundle .integration-daemon-start
 
 	# TODO consider using frozen images for the dockercore/builder-deb tags
 
@@ -63,5 +62,5 @@ set -e
 		docker rmi "$tempImage"
 	done
 
-	source "${MAKEDIR}/.integration-daemon-stop"
+	bundle .test-integration-stop
 ) 2>&1 | tee -a "$DEST/test.log"

+ 2 - 2
hack/make/test-docker-py

@@ -3,7 +3,7 @@ set -e
 
 # subshell so that we can export PATH without breaking other things
 (
-	source "${MAKEDIR}/.integration-daemon-start"
+	bundle .integration-daemon-start
 
 	dockerPy='/docker-py'
 	[ -d "$dockerPy" ] || {
@@ -14,5 +14,5 @@ set -e
 	# exporting PYTHONPATH to import "docker" from our local docker-py
 	test_env PYTHONPATH="$dockerPy" python "$dockerPy/tests/integration_test.py"
 
-	source "${MAKEDIR}/.integration-daemon-stop"
+	bundle .integration-daemon-stop
 ) 2>&1 | tee -a "$DEST/test.log"

+ 3 - 5
hack/make/test-integration-cli

@@ -7,13 +7,11 @@ bundle_test_integration_cli() {
 
 # subshell so that we can export PATH without breaking other things
 (
-	source "${MAKEDIR}/.integration-daemon-start"
+	bundle .integration-daemon-start
 
-	source "${MAKEDIR}/.ensure-frozen-images"
-	source "${MAKEDIR}/.ensure-httpserver"
-	source "${MAKEDIR}/.ensure-emptyfs"
+	bundle .integration-daemon-setup
 
 	bundle_test_integration_cli
 
-	source "${MAKEDIR}/.integration-daemon-stop"
+	bundle .integration-daemon-stop
 ) 2>&1 | tee -a "$DEST/test.log"