From 5fa334f62cc859e7014b325a8b422eb211ad1a9d Mon Sep 17 00:00:00 2001 From: Clint Wylie Date: Fri, 18 Dec 2020 14:16:55 -0800 Subject: [PATCH] fix integration test override config which requires environment variables before calling compose --- integration-tests/script/docker_run_cluster.sh | 10 ++++++++-- integration-tests/stop_cluster.sh | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/integration-tests/script/docker_run_cluster.sh b/integration-tests/script/docker_run_cluster.sh index b91869fcbe73..23a1e8276ade 100755 --- a/integration-tests/script/docker_run_cluster.sh +++ b/integration-tests/script/docker_run_cluster.sh @@ -44,6 +44,12 @@ fi docker-compose -f ${DOCKERDIR}/docker-compose.druid-hadoop.yml up -d fi - # Start Druid cluster - docker-compose $(getComposeArgs) up -d + if [ -z "$DRUID_INTEGRATION_TEST_OVERRIDE_CONFIG_PATH" ] + then + # Start Druid cluster + docker-compose $(getComposeArgs) up -d + else + # run druid cluster with override config + OVERRIDE_ENV=$DRUID_INTEGRATION_TEST_OVERRIDE_CONFIG_PATH docker-compose $(getComposeArgs) up -d + fi } diff --git a/integration-tests/stop_cluster.sh b/integration-tests/stop_cluster.sh index d23d226c2cb3..6fdbeb26f8c1 100755 --- a/integration-tests/stop_cluster.sh +++ b/integration-tests/stop_cluster.sh @@ -26,7 +26,22 @@ then exit 0 fi -docker-compose $(getComposeArgs) down + +# stop hadoop container if it exists (can't use docker-compose down because it shares network) +HADOOP_CONTAINER="$(docker ps -aq -f name=druid-it-hadoop)" +if [ ! -z "$HADOOP_CONTAINER" ] +then + docker stop druid-it-hadoop + docker rm druid-it-hadoop +fi + +# bring down using the same compose args we started with +if [ -z "$DRUID_INTEGRATION_TEST_OVERRIDE_CONFIG_PATH" ] +then + docker-compose $(getComposeArgs) down +else + OVERRIDE_ENV=$DRUID_INTEGRATION_TEST_OVERRIDE_CONFIG_PATH docker-compose $(getComposeArgs) down +fi if [ ! -z "$(docker network ls -q -f name=druid-it-net)" ] then