2020-12-18 01:50:12 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-11-04 10:03:25 -04:00
|
|
|
# picks appropriate docker-compose arguments to use when bringing up and down integration test clusters
|
2020-12-18 01:50:12 -05:00
|
|
|
# for a given test group
|
|
|
|
getComposeArgs()
|
|
|
|
{
|
2022-01-06 02:33:04 -05:00
|
|
|
# Sanity check: DRUID_INTEGRATION_TEST_INDEXER must be "indexer" or "middleManager"
|
|
|
|
if [ "$DRUID_INTEGRATION_TEST_INDEXER" != "indexer" ] && [ "$DRUID_INTEGRATION_TEST_INDEXER" != "middleManager" ]
|
2020-12-18 01:50:12 -05:00
|
|
|
then
|
2022-01-06 02:33:04 -05:00
|
|
|
echo "DRUID_INTEGRATION_TEST_INDEXER must be 'indexer' or 'middleManager' (is '$DRUID_INTEGRATION_TEST_INDEXER')"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ "$DRUID_INTEGRATION_TEST_INDEXER" = "indexer" ]
|
|
|
|
then
|
|
|
|
# Sanity check: cannot combine CliIndexer tests with security, query-retry tests
|
|
|
|
if [ "$DRUID_INTEGRATION_TEST_GROUP" = "security" ] || [ "$DRUID_INTEGRATION_TEST_GROUP" = "ldap-security" ] || [ "$DRUID_INTEGRATION_TEST_GROUP" = "query-retry" ] || [ "$DRUID_INTEGRATION_TEST_GROUP" = "query-error" ] || [ "$DRUID_INTEGRATION_TEST_GROUP" = "high-availability" ]
|
2020-12-18 01:50:12 -05:00
|
|
|
then
|
2022-01-06 02:33:04 -05:00
|
|
|
echo "Cannot run test group '$DRUID_INTEGRATION_TEST_GROUP' with CliIndexer"
|
2020-12-18 01:50:12 -05:00
|
|
|
exit 1
|
2021-03-08 11:12:12 -05:00
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "kafka-data-format" ]
|
|
|
|
then
|
2022-01-06 02:33:04 -05:00
|
|
|
# Replace MiddleManager with Indexer + schema registry container
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.cli-indexer.yml -f ${DOCKERDIR}/docker-compose.schema-registry-indexer.yml"
|
2020-12-18 01:50:12 -05:00
|
|
|
else
|
2022-01-06 02:33:04 -05:00
|
|
|
# Replace MiddleManager with Indexer
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.cli-indexer.yml"
|
2020-12-18 01:50:12 -05:00
|
|
|
fi
|
2022-01-06 02:33:04 -05:00
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "security" ]
|
|
|
|
then
|
|
|
|
# default + additional druid router (custom-check-tls, permissive-tls, no-client-auth-tls)
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.yml -f ${DOCKERDIR}/docker-compose.security.yml"
|
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "ldap-security" ]
|
|
|
|
then
|
|
|
|
# default + additional druid router (custom-check-tls, permissive-tls, no-client-auth-tls)
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.yml -f ${DOCKERDIR}/docker-compose.ldap-security.yml"
|
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "query-retry" ]
|
|
|
|
then
|
|
|
|
# default + additional historical modified for query retry test
|
|
|
|
# See CliHistoricalForQueryRetryTest.
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.query-retry-test.yml"
|
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "query-error" ]
|
|
|
|
then
|
|
|
|
# default + additional historical modified for query error test
|
|
|
|
# See CliHistoricalForQueryRetryTest.
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.query-error-test.yml"
|
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "high-availability" ]
|
|
|
|
then
|
|
|
|
# the 'high availability' test cluster with multiple coordinators and overlords
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.high-availability.yml"
|
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "kafka-data-format" ]
|
|
|
|
then
|
|
|
|
# default + schema registry container
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.yml -f ${DOCKERDIR}/docker-compose.schema-registry.yml"
|
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "kinesis-data-format" ]
|
|
|
|
then
|
|
|
|
# default + with override config + schema registry container
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.yml -f ${DOCKERDIR}/docker-compose.schema-registry.yml"
|
2023-12-05 06:27:25 -05:00
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "centralized-datasource-schema" ]
|
2023-11-04 10:03:25 -04:00
|
|
|
then
|
|
|
|
# cluster with overriden properties for broker and coordinator
|
2023-12-05 06:27:25 -05:00
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.centralized-datasource-schema.yml"
|
2024-04-24 12:52:53 -04:00
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "cds-task-schema-publish-disabled" ]
|
|
|
|
then
|
|
|
|
# cluster with overriden properties for broker and coordinator
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.cds-task-schema-publish-disabled.yml"
|
|
|
|
elif [ "$DRUID_INTEGRATION_TEST_GROUP" = "cds-coordinator-smq-disabled" ]
|
|
|
|
then
|
|
|
|
# cluster with overriden properties for broker and coordinator
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.cds-coordinator-smq-disabled.yml"
|
2020-12-18 01:50:12 -05:00
|
|
|
else
|
2022-01-06 02:33:04 -05:00
|
|
|
# default
|
|
|
|
echo "-f ${DOCKERDIR}/docker-compose.yml"
|
2020-12-18 01:50:12 -05:00
|
|
|
fi
|
|
|
|
}
|