@cryptotaxi247 / kubo / commits / 8a7d5e924

Rename DOCKER_HOST to TEST_DOCKER_HOST to avoid conflicts

DOCKER_HOST is a special environment variable of the Docker CLI so there's risk of creating conflicts whenever attempting to use `docker` in the test suite; it also makes it difficult to run the same full suite locally using the same setup since DOCKER_HOST is a fixed variable in t0700-remotepin.sh

Rod Vagg committed Jul 21, 2021 at 14:41 UTC 8a7d5e92442376fcadaefa8f7aebdc4346642afd
2 files changed +6 -6
.circleci/config.yml
+3 -3
@@ -147,10 +147,10 @@ jobs:
147 - run:
148 name: Setup Environment Variables
149 # we need the docker host IP; all ports exported by child containers can be accessed there.
150 - command: echo "export DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')" >> $BASH_ENV
150 + command: echo "export TEST_DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')" >> $BASH_ENV
151 - run:
152 - echo DOCKER_HOST=$DOCKER_HOST &&
153 - make -O -j 3 coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1 DOCKER_HOST=$DOCKER_HOST
152 + echo TEST_DOCKER_HOST=$TEST_DOCKER_HOST &&
153 + make -O -j 3 coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1 TEST_DOCKER_HOST=$TEST_DOCKER_HOST
154
155 - run:
156 when: always
test/sharness/t0700-remotepin.sh
+3 -3
@@ -4,9 +4,9 @@ test_description="Test ipfs remote pinning operations"
4
5 . lib/test-lib.sh
6
7 -if [ -z ${DOCKER_HOST+x} ]; then
7 +if [ -z ${TEST_DOCKER_HOST+x} ]; then
8 # TODO: set up instead of skipping?
9 - skip_all='Skipping pinning service integration tests: missing DOCKER_HOST, remote pinning service not available'
9 + skip_all='Skipping pinning service integration tests: missing TEST_DOCKER_HOST, remote pinning service not available'
10 test_done
11 fi
12
@@ -15,7 +15,7 @@ test_init_ipfs
15 test_launch_ipfs_daemon
16
17 # create user on pinning service
18 -TEST_PIN_SVC="http://${DOCKER_HOST}:5000/api/v1"
18 +TEST_PIN_SVC="http://${TEST_DOCKER_HOST}:5000/api/v1"
19 TEST_PIN_SVC_KEY=$(curl -s -X POST "$TEST_PIN_SVC/users" -d email="go-ipfs-sharness@ipfs.example.com" | jq --raw-output .access_token)
20
21 # pin remote service add|ls|rm