You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by cw...@apache.org on 2026/03/24 04:57:06 UTC
(druid) branch master updated: refactor: migrate integration-tests-ex/tools into embedded-tests (#19175)
This is an automated email from the ASF dual-hosted git repository.
cwylie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 4bd73dab5ff refactor: migrate integration-tests-ex/tools into embedded-tests (#19175)
4bd73dab5ff is described below
commit 4bd73dab5ffd96b5ab3f1858c5eeaed7a24315e8
Author: Clint Wylie <cw...@apache.org>
AuthorDate: Mon Mar 23 21:56:58 2026 -0700
refactor: migrate integration-tests-ex/tools into embedded-tests (#19175)
changes:
* moved useful classes from integration-tests-ex/tools into embedded-tests, deleted integration-tests-ex/
* remove some unused github actions scripts
* mark all dependencies of embedded-tests as test scope
* set enforcer to ignore test scope for requireUpperBoundDeps in embedded-tests
---
.github/workflows/cron-job-its.yml | 26 -
embedded-tests/pom.xml | 425 ++++++----------
.../testing/embedded/azure/AzureTestUtil.java | 2 +-
.../embedded/compact/CompactionSupervisorTest.java | 8 +-
.../embedded/indexer/AbstractITBatchIndexTest.java | 2 +-
.../testing/embedded/indexer/IndexerTest.java | 2 +-
.../embedded/indexer/QueryResultsVerifier.java | 8 +-
.../embedded/indexing/SchemaRegistryResource.java | 16 +
.../indexing/StreamIndexDataFormatsTestBase.java | 20 +-
.../embedded/indexing/StreamIndexTestBase.java | 8 +-
.../testing/embedded/k8s/K3sClusterResource.java | 2 +-
.../testing/embedded/kinesis/KinesisResource.java | 2 +-
.../embedded/server/KafkaMultiSupervisorTest.java | 2 +-
.../embedded}/tools/AvroEventSerializer.java | 2 +-
.../tools/AvroSchemaRegistryEventSerializer.java | 18 +-
.../embedded}/tools/CsvEventSerializer.java | 2 +-
.../embedded}/tools/DelimitedEventSerializer.java | 2 +-
.../testing/embedded}/tools/EventSerializer.java | 2 +-
.../embedded}/tools/JsonEventSerializer.java | 2 +-
.../embedded}/tools/ProtobufEventSerializer.java | 2 +-
.../ProtobufSchemaRegistryEventSerializer.java | 18 +-
.../testing/embedded}/tools/StreamEventWriter.java | 2 +-
.../testing/embedded}/tools/StreamGenerator.java | 2 +-
.../embedded}/tools/SyntheticStreamGenerator.java | 2 +-
.../embedded/tools/ThriftEventSerializer.java | 1 -
.../tools/WikipediaStreamEventStreamGenerator.java | 2 +-
.../embedded}/utils/AbstractQueryWithResults.java | 2 +-
.../druid/testing/embedded/utils}/ITRetryUtil.java | 2 +-
.../embedded}/utils/MsqQueryWithResults.java | 2 +-
.../embedded}/utils/QueryResultVerifier.java | 2 +-
.../testing/embedded}/utils/QueryWithResults.java | 2 +-
.../embedded}/utils/SqlQueryWithResults.java | 2 +-
integration-tests-ex/.gitignore | 1 -
integration-tests-ex/tools/README.md | 48 --
integration-tests-ex/tools/pom.xml | 239 ---------
.../tools/CliHistoricalForQueryErrorTest.java | 57 ---
.../testing/tools/ConfigFileConfigProvider.java | 557 ---------------------
.../testing/tools/CustomNodeRoleClientModule.java | 39 --
.../druid/testing/tools/DockerConfigProvider.java | 479 ------------------
.../testing/tools/IntegrationTestingConfig.java | 200 --------
.../tools/IntegrationTestingConfigProvider.java | 34 --
.../druid/testing/tools/KafkaEventWriter.java | 155 ------
.../org/apache/druid/testing/tools/KafkaUtil.java | 68 ---
.../tools/QueryRetryTestCommandCreator.java | 33 --
.../tools/ServerManagerForQueryErrorTest.java | 390 ---------------
.../apache/druid/testing/tools/SleepExprMacro.java | 100 ----
.../testing/tools/SleepOperatorConversion.java | 62 ---
.../org/apache/druid/testing/tools/package.java | 25 -
.../org.apache.druid.cli.CliCommandCreator | 16 -
.../org.apache.druid.initialization.DruidModule | 16 -
it.sh | 316 ------------
pom.xml | 1 -
52 files changed, 227 insertions(+), 3201 deletions(-)
diff --git a/.github/workflows/cron-job-its.yml b/.github/workflows/cron-job-its.yml
index 41936aa38c0..82798605e0a 100644
--- a/.github/workflows/cron-job-its.yml
+++ b/.github/workflows/cron-job-its.yml
@@ -30,32 +30,6 @@ on:
- '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' # release branches
jobs:
- build:
- if: (github.event_name == 'schedule' && github.repository == 'apache/druid')
- name: build (jdk17)
- runs-on: ubuntu-latest
- steps:
- - name: Checkout branch
- uses: actions/checkout@v6
-
- - name: setup java
- uses: actions/setup-java@v5
- with:
- java-version: '17'
- distribution: 'zulu'
-
- - name: Cache Maven m2 repository
- id: maven
- uses: actions/cache@v5
- with:
- path: ~/.m2/repository
- key: maven-${{ runner.os }}-17-${{ github.sha }}
-
- - name: Maven build
- id: maven_build
- run: |
- ./it.sh ci
-
security_vulnerabilities:
if: github.repository == 'apache/druid'
name: security vulnerabilities
diff --git a/embedded-tests/pom.xml b/embedded-tests/pom.xml
index 7611ce57793..5f4874f1d0f 100644
--- a/embedded-tests/pom.xml
+++ b/embedded-tests/pom.xml
@@ -40,101 +40,128 @@
</parent>
<dependencies>
+ <!-- Test dependencies -->
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-processing</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-indexing-service</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
<artifactId>druid-kafka-indexing-service</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-multi-stage-query</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
<artifactId>druid-catalog</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-server</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-sql</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
<artifactId>druid-testcontainers</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
<artifactId>druid-testing-tools</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-common</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>2.29.1</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
<version>2.27.0</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-storage</artifactId>
<version>8.6.0</version>
+ <scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
@@ -157,18 +184,20 @@
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
+ <scope>test</scope>
</dependency>
- <!-- Test dependencies -->
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-processing</artifactId>
+ <scope>test</scope>
<type>test-jar</type>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-server</artifactId>
+ <scope>test</scope>
<type>test-jar</type>
<version>${project.parent.version}</version>
</dependency>
@@ -176,12 +205,14 @@
<groupId>org.apache.druid</groupId>
<artifactId>druid-sql</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-services</artifactId>
<version>${project.parent.version}</version>
+ <scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
@@ -194,13 +225,8 @@
<groupId>org.apache.druid</groupId>
<artifactId>druid-indexing-service</artifactId>
<version>${project.parent.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.druid.integration-tests</groupId>
- <artifactId>druid-it-tools</artifactId>
- <version>${project.parent.version}</version>
<scope>test</scope>
+ <type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
@@ -281,37 +307,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.apache.iceberg</groupId>
- <artifactId>iceberg-api</artifactId>
- <version>${iceberg.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.iceberg</groupId>
- <artifactId>iceberg-core</artifactId>
- <version>${iceberg.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.avro</groupId>
- <artifactId>avro</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.iceberg</groupId>
- <artifactId>iceberg-parquet</artifactId>
- <version>${iceberg.version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- Let parquet version be driven by druid-parquet-extensions (1.15.2) -->
- <exclusion>
- <groupId>org.apache.parquet</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.druid.extensions.contrib</groupId>
<artifactId>kafka-emitter</artifactId>
@@ -340,7 +335,7 @@
<groupId>org.apache.druid</groupId>
<artifactId>druid-gcp-common</artifactId>
<version>${project.parent.version}</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
@@ -366,12 +361,6 @@
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client-minicluster</artifactId>
- <version>${hadoop.compile.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
<artifactId>druid-parquet-extensions</artifactId>
@@ -398,6 +387,12 @@
<version>${protobuf.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf.version}</version>
+ <scope>test</scope>
+ </dependency>
<!-- Some embedded tests use the router and the web-console for debugging -->
<dependency>
@@ -413,10 +408,42 @@
<artifactId>datasketches-java</artifactId>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-api</artifactId>
+ <version>${iceberg.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-core</artifactId>
+ <version>${iceberg.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-parquet</artifactId>
+ <version>${iceberg.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <!-- Let parquet version be driven by druid-parquet-extensions (1.15.2) -->
+ <exclusion>
+ <groupId>org.apache.parquet</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- <version>${scala.library.version}</version>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client-minicluster</artifactId>
+ <version>${hadoop.compile.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -437,6 +464,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
@@ -446,6 +474,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
@@ -457,11 +486,6 @@
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
@@ -652,20 +676,63 @@
<version>${aws.sdk.v2.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.github.os72</groupId>
+ <artifactId>protobuf-dynamic</artifactId>
+ <version>0.9.3</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-protobuf-provider</artifactId>
- <version>6.2.12</version>
+ <version>${confluent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ <version>${avro.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>io.kubernetes</groupId>
- <artifactId>client-java-api</artifactId>
+ <groupId>io.confluent</groupId>
+ <artifactId>kafka-schema-registry-client</artifactId>
+ <version>${confluent.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -690,212 +757,6 @@
<version>0.13.0</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.google.api</groupId>
- <artifactId>gax</artifactId>
- <version>2.37.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client-api</artifactId>
- <version>${hadoop.compile.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- needed by iceberg extension, this is copied from iceberg pom -->
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-common</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty-buffer</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-net</groupId>
- <artifactId>commons-net</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-client</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-recipes</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-math3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>net.java.dev.jets3t</groupId>
- <artifactId>jets3t</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-json</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.github.pjfanning</groupId>
- <artifactId>jersey-json</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- </exclusion>
- <!-- Following are excluded to remove security vulnerabilities: -->
- <exclusion>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.reload4j</groupId>
- <artifactId>reload4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-servlet</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-reload4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.nimbusds</groupId>
- <artifactId>nimbus-jose-jwt</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.github.stephenc.jcip</groupId>
- <artifactId>jcip-annotations</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- </exclusion>
- <exclusion>
- <groupId>io.dropwizard.metrics</groupId>
- <artifactId>metrics-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dnsjava</groupId>
- <artifactId>dnsjava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.xerial.snappy</groupId>
- <artifactId>snappy-java</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
@@ -945,6 +806,42 @@
</ignoredUsedUndeclaredDependencies>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>3.6.2</version>
+ <executions>
+ <execution>
+ <id>default-cli</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <banDuplicatePomDependencyVersions/>
+ <bannedDependencies>
+ <excludes>
+ <!--LGPL licenced library-->
+ <exclude>com.google.code.findbugs:annotations</exclude>
+ <!-- shouldn't be loaded alongside with log4j-slf4j2-impl -->
+ <exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
+ <!-- See https://github.com/apache/druid/pull/17370 -->
+ <exclude>javax.xml.bind:jaxb-api</exclude>
+ <exclude>org.eclipse.jetty.toolchain:jetty-servlet-api</exclude>
+ </excludes>
+ </bannedDependencies>
+ <requireUpperBoundDeps>
+ <excludedScopes>
+ <excludedScope>test</excludedScope>
+ </excludedScopes>
+ </requireUpperBoundDeps>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<!-- Skip this module from jacoco coverage as it contains only tests -->
<plugin>
<groupId>org.jacoco</groupId>
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/azure/AzureTestUtil.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/azure/AzureTestUtil.java
index 4375d2a6c61..7041997a18f 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/azure/AzureTestUtil.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/azure/AzureTestUtil.java
@@ -25,7 +25,7 @@ import com.microsoft.azure.storage.blob.CloudBlobContainer;
import com.microsoft.azure.storage.blob.CloudBlockBlob;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.testing.embedded.indexing.Resources;
-import org.apache.druid.testing.tools.ITRetryUtil;
+import org.apache.druid.testing.embedded.utils.ITRetryUtil;
import java.io.File;
import java.io.IOException;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionSupervisorTest.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionSupervisorTest.java
index 838bb559989..ddcf41f23db 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionSupervisorTest.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionSupervisorTest.java
@@ -90,10 +90,10 @@ import org.apache.druid.testing.embedded.EmbeddedOverlord;
import org.apache.druid.testing.embedded.EmbeddedRouter;
import org.apache.druid.testing.embedded.indexing.MoreResources;
import org.apache.druid.testing.embedded.junit5.EmbeddedClusterTestBase;
-import org.apache.druid.testing.tools.EventSerializer;
-import org.apache.druid.testing.tools.JsonEventSerializer;
-import org.apache.druid.testing.tools.StreamGenerator;
-import org.apache.druid.testing.tools.WikipediaStreamEventStreamGenerator;
+import org.apache.druid.testing.embedded.tools.EventSerializer;
+import org.apache.druid.testing.embedded.tools.JsonEventSerializer;
+import org.apache.druid.testing.embedded.tools.StreamGenerator;
+import org.apache.druid.testing.embedded.tools.WikipediaStreamEventStreamGenerator;
import org.apache.druid.timeline.DataSegment;
import org.apache.druid.timeline.partition.DimensionRangeShardSpec;
import org.hamcrest.Matcher;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/AbstractITBatchIndexTest.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/AbstractITBatchIndexTest.java
index c3c7cdd6d86..fbd7716c7bb 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/AbstractITBatchIndexTest.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/AbstractITBatchIndexTest.java
@@ -44,7 +44,7 @@ import org.apache.druid.query.http.SqlTaskStatus;
import org.apache.druid.rpc.RequestBuilder;
import org.apache.druid.testing.embedded.indexing.Resources;
import org.apache.druid.testing.embedded.msq.EmbeddedMSQApis;
-import org.apache.druid.testing.tools.ITRetryUtil;
+import org.apache.druid.testing.embedded.utils.ITRetryUtil;
import org.apache.druid.timeline.DataSegment;
import org.apache.druid.timeline.SegmentTimeline;
import org.apache.druid.timeline.TimelineObjectHolder;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/IndexerTest.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/IndexerTest.java
index 0b7a8d7faf6..2a017539246 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/IndexerTest.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/IndexerTest.java
@@ -27,7 +27,7 @@ import org.apache.druid.metadata.LockFilterPolicy;
import org.apache.druid.server.coordinator.CoordinatorDynamicConfig;
import org.apache.druid.testing.embedded.EmbeddedClusterApis;
import org.apache.druid.testing.embedded.EmbeddedDruidCluster;
-import org.apache.druid.testing.tools.ITRetryUtil;
+import org.apache.druid.testing.embedded.utils.ITRetryUtil;
import org.joda.time.Interval;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/QueryResultsVerifier.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/QueryResultsVerifier.java
index 310625aa092..d08e6b9be58 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/QueryResultsVerifier.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexer/QueryResultsVerifier.java
@@ -28,10 +28,10 @@ import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.query.http.ClientSqlQuery;
import org.apache.druid.segment.TestHelper;
import org.apache.druid.testing.embedded.EmbeddedDruidCluster;
-import org.apache.druid.testing.utils.AbstractQueryWithResults;
-import org.apache.druid.testing.utils.QueryResultVerifier;
-import org.apache.druid.testing.utils.QueryWithResults;
-import org.apache.druid.testing.utils.SqlQueryWithResults;
+import org.apache.druid.testing.embedded.utils.AbstractQueryWithResults;
+import org.apache.druid.testing.embedded.utils.QueryResultVerifier;
+import org.apache.druid.testing.embedded.utils.QueryWithResults;
+import org.apache.druid.testing.embedded.utils.SqlQueryWithResults;
import java.nio.charset.StandardCharsets;
import java.util.List;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/SchemaRegistryResource.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/SchemaRegistryResource.java
index 7460abd03ad..6c89409f3de 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/SchemaRegistryResource.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/SchemaRegistryResource.java
@@ -19,11 +19,14 @@
package org.apache.druid.testing.embedded.indexing;
+import io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.testing.embedded.EmbeddedDruidCluster;
import org.apache.druid.testing.embedded.TestcontainerResource;
import org.testcontainers.redpanda.RedpandaContainer;
+import java.util.Map;
+
/**
* A resource for managing a Schema Registry instance in embedded tests.
* <p>
@@ -32,6 +35,19 @@ import org.testcontainers.redpanda.RedpandaContainer;
*/
public class SchemaRegistryResource extends TestcontainerResource<RedpandaContainer>
{
+ public static CachedSchemaRegistryClient createSchemaRegistryClient(String schemaRegistryHost)
+ {
+ return new CachedSchemaRegistryClient(
+ StringUtils.format("http://%s", schemaRegistryHost),
+ Integer.MAX_VALUE,
+ Map.of(
+ "basic.auth.credentials.source", "USER_INFO",
+ "basic.auth.user.info", "druid:diurd"
+ ),
+ Map.of()
+ );
+ }
+
private static final String SCHEMA_REGISTRY_IMAGE = "docker.redpanda.com/redpandadata/redpanda:v25.3.5";
private static final int SCHEMA_REGISTRY_PORT = 8081;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexDataFormatsTestBase.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexDataFormatsTestBase.java
index f25e22a5aa5..779a3ebde41 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexDataFormatsTestBase.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexDataFormatsTestBase.java
@@ -46,18 +46,18 @@ import org.apache.druid.testing.embedded.EmbeddedIndexer;
import org.apache.druid.testing.embedded.EmbeddedOverlord;
import org.apache.druid.testing.embedded.StreamIngestResource;
import org.apache.druid.testing.embedded.junit5.EmbeddedClusterTestBase;
+import org.apache.druid.testing.embedded.tools.AvroEventSerializer;
+import org.apache.druid.testing.embedded.tools.AvroSchemaRegistryEventSerializer;
+import org.apache.druid.testing.embedded.tools.CsvEventSerializer;
+import org.apache.druid.testing.embedded.tools.DelimitedEventSerializer;
+import org.apache.druid.testing.embedded.tools.EventSerializer;
+import org.apache.druid.testing.embedded.tools.JsonEventSerializer;
+import org.apache.druid.testing.embedded.tools.ProtobufEventSerializer;
+import org.apache.druid.testing.embedded.tools.ProtobufSchemaRegistryEventSerializer;
+import org.apache.druid.testing.embedded.tools.StreamGenerator;
import org.apache.druid.testing.embedded.tools.ThriftEventSerializer;
+import org.apache.druid.testing.embedded.tools.WikipediaStreamEventStreamGenerator;
import org.apache.druid.testing.embedded.tools.WikipediaThriftEvent;
-import org.apache.druid.testing.tools.AvroEventSerializer;
-import org.apache.druid.testing.tools.AvroSchemaRegistryEventSerializer;
-import org.apache.druid.testing.tools.CsvEventSerializer;
-import org.apache.druid.testing.tools.DelimitedEventSerializer;
-import org.apache.druid.testing.tools.EventSerializer;
-import org.apache.druid.testing.tools.JsonEventSerializer;
-import org.apache.druid.testing.tools.ProtobufEventSerializer;
-import org.apache.druid.testing.tools.ProtobufSchemaRegistryEventSerializer;
-import org.apache.druid.testing.tools.StreamGenerator;
-import org.apache.druid.testing.tools.WikipediaStreamEventStreamGenerator;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexTestBase.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexTestBase.java
index 772d1bcc9b0..821d776947d 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexTestBase.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/StreamIndexTestBase.java
@@ -42,10 +42,10 @@ import org.apache.druid.testing.embedded.EmbeddedRouter;
import org.apache.druid.testing.embedded.StreamIngestResource;
import org.apache.druid.testing.embedded.junit5.EmbeddedClusterTestBase;
import org.apache.druid.testing.embedded.kinesis.KinesisResource;
-import org.apache.druid.testing.tools.EventSerializer;
-import org.apache.druid.testing.tools.JsonEventSerializer;
-import org.apache.druid.testing.tools.StreamGenerator;
-import org.apache.druid.testing.tools.WikipediaStreamEventStreamGenerator;
+import org.apache.druid.testing.embedded.tools.EventSerializer;
+import org.apache.druid.testing.embedded.tools.JsonEventSerializer;
+import org.apache.druid.testing.embedded.tools.StreamGenerator;
+import org.apache.druid.testing.embedded.tools.WikipediaStreamEventStreamGenerator;
import org.joda.time.Period;
import org.junit.jupiter.api.Assertions;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/k8s/K3sClusterResource.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/k8s/K3sClusterResource.java
index d997a87f4a5..41636afa62d 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/k8s/K3sClusterResource.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/k8s/K3sClusterResource.java
@@ -42,7 +42,7 @@ import org.apache.druid.testing.embedded.TestFolder;
import org.apache.druid.testing.embedded.TestcontainerResource;
import org.apache.druid.testing.embedded.docker.DruidContainerResource;
import org.apache.druid.testing.embedded.indexing.Resources;
-import org.apache.druid.testing.tools.ITRetryUtil;
+import org.apache.druid.testing.embedded.utils.ITRetryUtil;
import org.testcontainers.k3s.K3sContainer;
import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/kinesis/KinesisResource.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/kinesis/KinesisResource.java
index 5d675de59a7..d8d51909567 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/kinesis/KinesisResource.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/kinesis/KinesisResource.java
@@ -25,7 +25,7 @@ import org.apache.druid.common.aws.AWSModule;
import org.apache.druid.indexing.kinesis.KinesisIndexingServiceModule;
import org.apache.druid.testing.embedded.EmbeddedDruidCluster;
import org.apache.druid.testing.embedded.StreamIngestResource;
-import org.apache.druid.testing.tools.ITRetryUtil;
+import org.apache.druid.testing.embedded.utils.ITRetryUtil;
import org.testcontainers.localstack.LocalStackContainer;
import org.testcontainers.utility.DockerImageName;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/KafkaMultiSupervisorTest.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/KafkaMultiSupervisorTest.java
index 7bfb05c84c3..14ac2444e5d 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/KafkaMultiSupervisorTest.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/KafkaMultiSupervisorTest.java
@@ -27,7 +27,7 @@ import org.apache.druid.indexing.kafka.simulate.KafkaResource;
import org.apache.druid.indexing.kafka.supervisor.KafkaSupervisorSpec;
import org.apache.druid.testing.embedded.StreamIngestResource;
import org.apache.druid.testing.embedded.indexing.StreamIndexTestBase;
-import org.apache.druid.testing.tools.WikipediaStreamEventStreamGenerator;
+import org.apache.druid.testing.embedded.tools.WikipediaStreamEventStreamGenerator;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/AvroEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/AvroEventSerializer.java
similarity index 98%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/AvroEventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/AvroEventSerializer.java
index e941372c80e..6745212cbb9 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/AvroEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/AvroEventSerializer.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/AvroSchemaRegistryEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/AvroSchemaRegistryEventSerializer.java
similarity index 83%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/AvroSchemaRegistryEventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/AvroSchemaRegistryEventSerializer.java
index 8a47adc5bb5..f6e7e7f31a3 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/AvroSchemaRegistryEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/AvroSchemaRegistryEventSerializer.java
@@ -17,10 +17,8 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
-import com.fasterxml.jackson.annotation.JacksonInject;
-import com.fasterxml.jackson.annotation.JsonCreator;
import io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericDatumWriter;
@@ -29,6 +27,7 @@ import org.apache.avro.io.DatumWriter;
import org.apache.avro.io.EncoderFactory;
import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.RetryUtils;
+import org.apache.druid.testing.embedded.indexing.SchemaRegistryResource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -40,7 +39,6 @@ public class AvroSchemaRegistryEventSerializer extends AvroEventSerializer
private static final int MAX_INITIALIZE_RETRIES = 10;
public static final String TYPE = "avro-schema-registry";
- private final IntegrationTestingConfig config;
private final CachedSchemaRegistryClient client;
private int schemaId = -1;
@@ -50,17 +48,7 @@ public class AvroSchemaRegistryEventSerializer extends AvroEventSerializer
String schemaRegistryHost
)
{
- this.config = null;
- this.client = KafkaUtil.createSchemaRegistryClient(schemaRegistryHost);
- }
-
- @JsonCreator
- public AvroSchemaRegistryEventSerializer(
- @JacksonInject IntegrationTestingConfig config
- )
- {
- this.config = config;
- this.client = KafkaUtil.createSchemaRegistryClient(config.getSchemaRegistryHost());
+ this.client = SchemaRegistryResource.createSchemaRegistryClient(schemaRegistryHost);
}
@Override
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CsvEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/CsvEventSerializer.java
similarity index 97%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CsvEventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/CsvEventSerializer.java
index 34789f6799e..5dfe6985b4b 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CsvEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/CsvEventSerializer.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import com.opencsv.CSVWriter;
import org.apache.druid.java.util.common.Pair;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/DelimitedEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/DelimitedEventSerializer.java
similarity index 96%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/DelimitedEventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/DelimitedEventSerializer.java
index eeb453bcc9a..75998ac24f2 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/DelimitedEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/DelimitedEventSerializer.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.StringUtils;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/EventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/EventSerializer.java
similarity index 97%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/EventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/EventSerializer.java
index dd6f8e8d1e0..73c023c4c86 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/EventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/EventSerializer.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/JsonEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/JsonEventSerializer.java
similarity index 97%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/JsonEventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/JsonEventSerializer.java
index b9ce2e4ea55..fbf1f7123c3 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/JsonEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/JsonEventSerializer.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonCreator;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ProtobufEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ProtobufEventSerializer.java
similarity index 98%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ProtobufEventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ProtobufEventSerializer.java
index 6cf0461c3a6..83ad5c863e8 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ProtobufEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ProtobufEventSerializer.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import com.github.os72.protobuf.dynamic.DynamicSchema;
import com.github.os72.protobuf.dynamic.MessageDefinition;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ProtobufSchemaRegistryEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ProtobufSchemaRegistryEventSerializer.java
similarity index 82%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ProtobufSchemaRegistryEventSerializer.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ProtobufSchemaRegistryEventSerializer.java
index 949de845e0a..dfe0dad5e5b 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ProtobufSchemaRegistryEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ProtobufSchemaRegistryEventSerializer.java
@@ -17,16 +17,15 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
-import com.fasterxml.jackson.annotation.JacksonInject;
-import com.fasterxml.jackson.annotation.JsonCreator;
import com.google.protobuf.Descriptors;
import com.google.protobuf.DynamicMessage;
import io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient;
import io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema;
import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.RetryUtils;
+import org.apache.druid.testing.embedded.indexing.SchemaRegistryResource;
import java.nio.ByteBuffer;
import java.util.List;
@@ -36,7 +35,6 @@ public class ProtobufSchemaRegistryEventSerializer extends ProtobufEventSerializ
private static final int MAX_INITIALIZE_RETRIES = 10;
public static final String TYPE = "protobuf-schema-registry";
- private final IntegrationTestingConfig config;
private final CachedSchemaRegistryClient client;
private int schemaId = -1;
@@ -44,17 +42,7 @@ public class ProtobufSchemaRegistryEventSerializer extends ProtobufEventSerializ
String schemaRegistryHost
)
{
- this.config = null;
- this.client = KafkaUtil.createSchemaRegistryClient(schemaRegistryHost);
- }
-
- @JsonCreator
- public ProtobufSchemaRegistryEventSerializer(
- @JacksonInject IntegrationTestingConfig config
- )
- {
- this.config = config;
- this.client = KafkaUtil.createSchemaRegistryClient(config.getSchemaRegistryHost());
+ this.client = SchemaRegistryResource.createSchemaRegistryClient(schemaRegistryHost);
}
@Override
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/StreamEventWriter.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/StreamEventWriter.java
similarity index 97%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/StreamEventWriter.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/StreamEventWriter.java
index cc28d5f41da..e7a58d9d042 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/StreamEventWriter.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/StreamEventWriter.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import java.io.Closeable;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/StreamGenerator.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/StreamGenerator.java
similarity index 97%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/StreamGenerator.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/StreamGenerator.java
index 10cb1a4f60c..65b6ba0f136 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/StreamGenerator.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/StreamGenerator.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import org.joda.time.DateTime;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SyntheticStreamGenerator.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/SyntheticStreamGenerator.java
similarity index 99%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SyntheticStreamGenerator.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/SyntheticStreamGenerator.java
index c54e9c39ec6..f1e7377b94b 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SyntheticStreamGenerator.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/SyntheticStreamGenerator.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.Pair;
diff --git a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ThriftEventSerializer.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ThriftEventSerializer.java
index 5f5767c5192..0a91404451d 100644
--- a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ThriftEventSerializer.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/ThriftEventSerializer.java
@@ -20,7 +20,6 @@
package org.apache.druid.testing.embedded.tools;
import org.apache.druid.java.util.common.Pair;
-import org.apache.druid.testing.tools.EventSerializer;
import org.apache.thrift.TException;
import org.apache.thrift.TSerializer;
import org.apache.thrift.protocol.TCompactProtocol;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/WikipediaStreamEventStreamGenerator.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/WikipediaStreamEventStreamGenerator.java
similarity index 98%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/WikipediaStreamEventStreamGenerator.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/WikipediaStreamEventStreamGenerator.java
index 28ecfdf0694..2ef28cf7037 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/WikipediaStreamEventStreamGenerator.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/tools/WikipediaStreamEventStreamGenerator.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.tools;
import org.apache.druid.common.utils.IdUtils;
import org.apache.druid.java.util.common.Pair;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/AbstractQueryWithResults.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/AbstractQueryWithResults.java
similarity index 97%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/AbstractQueryWithResults.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/AbstractQueryWithResults.java
index 34453bda379..62744ff3301 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/AbstractQueryWithResults.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/AbstractQueryWithResults.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.utils;
+package org.apache.druid.testing.embedded.utils;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ITRetryUtil.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/ITRetryUtil.java
similarity index 98%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ITRetryUtil.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/ITRetryUtil.java
index 31871908ed3..a083a275bb8 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ITRetryUtil.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/ITRetryUtil.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.tools;
+package org.apache.druid.testing.embedded.utils;
import io.netty.util.SuppressForbidden;
import org.apache.druid.java.util.common.ISE;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/MsqQueryWithResults.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/MsqQueryWithResults.java
similarity index 96%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/MsqQueryWithResults.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/MsqQueryWithResults.java
index 22aebc2da77..9cf9c5c6dd4 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/MsqQueryWithResults.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/MsqQueryWithResults.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.utils;
+package org.apache.druid.testing.embedded.utils;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/QueryResultVerifier.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/QueryResultVerifier.java
similarity index 98%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/QueryResultVerifier.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/QueryResultVerifier.java
index 7d8be55bf72..81b8a86a4dd 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/QueryResultVerifier.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/QueryResultVerifier.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.utils;
+package org.apache.druid.testing.embedded.utils;
import org.apache.druid.java.util.common.StringUtils;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/QueryWithResults.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/QueryWithResults.java
similarity index 96%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/QueryWithResults.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/QueryWithResults.java
index 35ff3c20ad7..ae7072f499c 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/QueryWithResults.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/QueryWithResults.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.utils;
+package org.apache.druid.testing.embedded.utils;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/SqlQueryWithResults.java b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/SqlQueryWithResults.java
similarity index 96%
rename from integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/SqlQueryWithResults.java
rename to embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/SqlQueryWithResults.java
index 53f434d788a..978372df9cb 100644
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/utils/SqlQueryWithResults.java
+++ b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/utils/SqlQueryWithResults.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.druid.testing.utils;
+package org.apache.druid.testing.embedded.utils;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/integration-tests-ex/.gitignore b/integration-tests-ex/.gitignore
deleted file mode 100644
index ae3c1726048..00000000000
--- a/integration-tests-ex/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/bin/
diff --git a/integration-tests-ex/tools/README.md b/integration-tests-ex/tools/README.md
deleted file mode 100644
index cb8f4353584..00000000000
--- a/integration-tests-ex/tools/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- ~ 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.
- -->
-
-# Testing Tools
-
-`it-tools` is a copy of `extensions-core/testing-tools` (module
-name `druid-testing-tools`.)
-
-The testing tools are added to the Druid test Docker image. The
-`druid-testing-tools` module defines most such additions. However,
-`integration-tests` defines a custom node role which also must be
-added to the image. `integration-tests` uses a different mechanism
-to do that addition.
-
-Here, we want a single extension for all the testing gizmos.
-This is a direct copy of the `druid-testing-tools`
-extension, along with a copy of the custom node role from
-`integration-tests`.
-
-The reason this is a copy, rather than fixing up `druid-testing-tools`
-is that the existing `integration-tests` must continue to run and it
-is very difficult to change or test them. (Which is the reason for
-this parallel approach.) To keep backward compatibility, and to avoid
-changing `integration-tests`, we keep the prior approach and make
-copies here for the new approach.
-
-The names should never clash: `it-tools` is only ever used
-within the `docker-test` project, and the `druid-testing-tools` is
-*not* included as a dependency.
-
-Over time, once `integration-tests` are converted, then the
-`druid-testing-tools` module can be deprecated in favor of this one.
diff --git a/integration-tests-ex/tools/pom.xml b/integration-tests-ex/tools/pom.xml
deleted file mode 100644
index ae462c8932a..00000000000
--- a/integration-tests-ex/tools/pom.xml
+++ /dev/null
@@ -1,239 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <properties>
- <enforcer.skip>true</enforcer.skip>
- </properties>
- <groupId>org.apache.druid.integration-tests</groupId>
- <artifactId>druid-it-tools</artifactId>
- <name>druid-it-tools</name>
- <description>Server-side integration testing tools</description>
-
- <parent>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid</artifactId>
- <version>37.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid-processing</artifactId>
- <version>${project.parent.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid-services</artifactId>
- <version>${project.parent.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid-sql</artifactId>
- <version>${project.parent.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid-server</artifactId>
- <version>${project.parent.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.avro</groupId>
- <artifactId>avro</artifactId>
- </dependency>
- <dependency>
- <groupId>io.confluent</groupId>
- <artifactId>kafka-schema-registry-client</artifactId>
- <version>6.2.12</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.avro</groupId>
- <artifactId>avro</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.ws.rs</groupId>
- <artifactId>jakarta.ws.rs-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.github.os72</groupId>
- <artifactId>protobuf-dynamic</artifactId>
- <version>0.9.3</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>io.confluent</groupId>
- <artifactId>kafka-protobuf-provider</artifactId>
- <version>6.2.12</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid-processing</artifactId>
- <version>${project.parent.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid-server</artifactId>
- <version>${project.parent.version}</version>
- <scope>test</scope>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.druid</groupId>
- <artifactId>druid-sql</artifactId>
- <version>${project.parent.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.github.rvesse</groupId>
- <artifactId>airline</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.ee8</groupId>
- <artifactId>jetty-ee8-servlet</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-servlet</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.calcite</groupId>
- <artifactId>calcite-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.kafka</groupId>
- <artifactId>kafka-clients</artifactId>
- <version>${apache.kafka.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-common</artifactId>
- </dependency>
- <dependency>
- <groupId>jakarta.validation</groupId>
- <artifactId>jakarta.validation-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.owasp</groupId>
- <artifactId>dependency-check-maven</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CliHistoricalForQueryErrorTest.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CliHistoricalForQueryErrorTest.java
deleted file mode 100644
index 89989bd5d51..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CliHistoricalForQueryErrorTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import com.github.rvesse.airline.annotations.Command;
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import org.apache.druid.cli.CliHistorical;
-import org.apache.druid.guice.LazySingleton;
-import org.apache.druid.java.util.common.logger.Logger;
-import org.apache.druid.query.QuerySegmentWalker;
-
-import java.util.Properties;
-
-@Command(
- name = "historical-for-query-error-test",
- description = "Runs a Historical node modified for query error test"
-)
-public class CliHistoricalForQueryErrorTest extends CliHistorical
-{
- private static final Logger log = new Logger(CliHistoricalForQueryErrorTest.class);
-
- public CliHistoricalForQueryErrorTest()
- {
- super();
- }
-
- @Inject
- @Override
- public void configure(Properties properties)
- {
- log.info("Historical is configured for testing query error on missing segments");
- }
-
- @Override
- public void bindQuerySegmentWalker(Binder binder)
- {
- binder.bind(QuerySegmentWalker.class).to(ServerManagerForQueryErrorTest.class).in(LazySingleton.class);
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ConfigFileConfigProvider.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ConfigFileConfigProvider.java
deleted file mode 100644
index 5d5fd204ebe..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ConfigFileConfigProvider.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.druid.java.util.common.StringUtils;
-import org.apache.druid.java.util.common.jackson.JacksonUtils;
-import org.apache.druid.java.util.common.logger.Logger;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-
-public class ConfigFileConfigProvider implements IntegrationTestingConfigProvider
-{
- private static final Logger LOG = new Logger(ConfigFileConfigProvider.class);
- private String routerHost;
- private String brokerHost;
- private String historicalHost;
- private String coordinatorHost;
- private String coordinatorTwoHost;
- private String overlordHost;
- private String overlordTwoHost;
- private String routerUrl;
- private String brokerUrl;
- private String historicalUrl;
- private String coordinatorUrl;
- private String coordinatorTwoUrl;
- private String overlordUrl;
- private String overlordTwoUrl;
- private String permissiveRouterUrl;
- private String noClientAuthRouterUrl;
- private String customCertCheckRouterUrl;
- private String routerTLSUrl;
- private String brokerTLSUrl;
- private String historicalTLSUrl;
- private String coordinatorTLSUrl;
- private String coordinatorTwoTLSUrl;
- private String overlordTLSUrl;
- private String overlordTwoTLSUrl;
- private String permissiveRouterTLSUrl;
- private String noClientAuthRouterTLSUrl;
- private String customCertCheckRouterTLSUrl;
- private String middleManagerHost;
- private String zookeeperHosts; // comma-separated list of host:port
- private String kafkaHost;
- private String schemaRegistryHost;
- private Map<String, String> props = null;
- private String username;
- private String password;
- private String cloudBucket;
- private String cloudPath;
- private String cloudRegion;
- private String s3AssumeRoleWithExternalId;
- private String s3AssumeRoleExternalId;
- private String s3AssumeRoleWithoutExternalId;
- private String hadoopGcsCredentialsPath;
- private String azureKey;
- private String streamEndpoint;
-
- @JsonCreator
- ConfigFileConfigProvider(@JsonProperty("configFile") String configFile)
- {
- loadProperties(configFile);
- }
-
- private void loadProperties(String configFile)
- {
- ObjectMapper jsonMapper = new ObjectMapper();
- try {
- props = jsonMapper.readValue(
- new File(configFile), JacksonUtils.TYPE_REFERENCE_MAP_STRING_STRING
- );
- }
- catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- routerHost = props.get("router_host");
- // there might not be a router; we want routerHost to be null in that case
- routerUrl = props.get("router_url");
- if (routerUrl == null) {
- if (null != routerHost) {
- routerUrl = StringUtils.format("http://%s:%s", routerHost, props.get("router_port"));
- }
- }
- routerTLSUrl = props.get("router_tls_url");
- if (routerTLSUrl == null) {
- if (null != routerHost) {
- routerTLSUrl = StringUtils.format("https://%s:%s", routerHost, props.get("router_tls_port"));
- }
- }
- permissiveRouterUrl = props.get("router_permissive_url");
- if (permissiveRouterUrl == null) {
- String permissiveRouterHost = props.get("router_permissive_host");
- if (null != permissiveRouterHost) {
- permissiveRouterUrl = StringUtils.format("http://%s:%s", permissiveRouterHost, props.get("router_permissive_port"));
- }
- }
- permissiveRouterTLSUrl = props.get("router_permissive_tls_url");
- if (permissiveRouterTLSUrl == null) {
- String permissiveRouterHost = props.get("router_permissive_host");
- if (null != permissiveRouterHost) {
- permissiveRouterTLSUrl = StringUtils.format("https://%s:%s", permissiveRouterHost, props.get("router_permissive_tls_port"));
- }
- }
- noClientAuthRouterUrl = props.get("router_no_client_auth_url");
- if (noClientAuthRouterUrl == null) {
- String noClientAuthRouterHost = props.get("router_no_client_auth_host");
- if (null != noClientAuthRouterHost) {
- noClientAuthRouterUrl = StringUtils.format("http://%s:%s", noClientAuthRouterHost, props.get("router_no_client_auth_port"));
- }
- }
- noClientAuthRouterTLSUrl = props.get("router_no_client_auth_tls_url");
- if (noClientAuthRouterTLSUrl == null) {
- String noClientAuthRouterHost = props.get("router_no_client_auth_host");
- if (null != noClientAuthRouterHost) {
- noClientAuthRouterTLSUrl = StringUtils.format("https://%s:%s", noClientAuthRouterHost, props.get("router_no_client_auth_tls_port"));
- }
- }
- customCertCheckRouterUrl = props.get("router_no_client_auth_url");
- if (customCertCheckRouterUrl == null) {
- String customCertCheckRouterHost = props.get("router_no_client_auth_host");
- if (null != customCertCheckRouterHost) {
- customCertCheckRouterUrl = StringUtils.format("http://%s:%s", customCertCheckRouterHost, props.get("router_no_client_auth_port"));
- }
- }
- customCertCheckRouterTLSUrl = props.get("router_no_client_auth_tls_url");
- if (customCertCheckRouterTLSUrl == null) {
- String customCertCheckRouterHost = props.get("router_no_client_auth_host");
- if (null != customCertCheckRouterHost) {
- customCertCheckRouterTLSUrl = StringUtils.format("https://%s:%s", customCertCheckRouterHost, props.get("router_no_client_auth_tls_port"));
- }
- }
-
- brokerHost = props.get("broker_host");
- brokerUrl = props.get("broker_url");
- if (brokerUrl == null) {
- brokerUrl = StringUtils.format("http://%s:%s", props.get("broker_host"), props.get("broker_port"));
- }
- brokerTLSUrl = props.get("broker_tls_url");
- if (brokerTLSUrl == null) {
- if (null != brokerHost) {
- brokerTLSUrl = StringUtils.format("https://%s:%s", brokerHost, props.get("broker_tls_port"));
- }
- }
-
- historicalHost = props.get("historical_host");
- historicalUrl = props.get("historical_url");
- if (historicalUrl == null) {
- historicalUrl = StringUtils.format("http://%s:%s", props.get("historical_host"), props.get("historical_port"));
- }
- historicalTLSUrl = props.get("historical_tls_url");
- if (historicalTLSUrl == null) {
- if (null != historicalHost) {
- historicalTLSUrl = StringUtils.format("https://%s:%s", historicalHost, props.get("historical_tls_port"));
- }
- }
-
- coordinatorHost = props.get("coordinator_host");
- coordinatorUrl = props.get("coordinator_url");
- if (coordinatorUrl == null) {
- coordinatorUrl = StringUtils.format("http://%s:%s", coordinatorHost, props.get("coordinator_port"));
- }
- coordinatorTLSUrl = props.get("coordinator_tls_url");
- if (coordinatorTLSUrl == null) {
- if (null != coordinatorHost) {
- coordinatorTLSUrl = StringUtils.format("https://%s:%s", coordinatorHost, props.get("coordinator_tls_port"));
- }
- }
-
- overlordHost = props.get("indexer_host");
- overlordUrl = props.get("indexer_url");
- if (overlordUrl == null) {
- overlordUrl = StringUtils.format("http://%s:%s", overlordHost, props.get("indexer_port"));
- }
- overlordTLSUrl = props.get("indexer_tls_url");
- if (overlordTLSUrl == null) {
- if (null != overlordHost) {
- overlordTLSUrl = StringUtils.format("https://%s:%s", overlordHost, props.get("indexer_tls_port"));
- }
- }
- coordinatorTwoHost = props.get("coordinator_two_host");
- coordinatorTwoUrl = props.get("coordinator_two_url");
- if (coordinatorTwoUrl == null) {
- coordinatorTwoUrl = StringUtils.format("http://%s:%s", coordinatorTwoHost, props.get("coordinator_two_port"));
- }
- coordinatorTwoTLSUrl = props.get("coordinator_two_tls_url");
- if (coordinatorTwoTLSUrl == null) {
- if (null != coordinatorTwoHost) {
- coordinatorTwoTLSUrl = StringUtils.format("https://%s:%s", coordinatorTwoHost, props.get("coordinator_two_tls_port"));
- }
- }
-
- overlordTwoHost = props.get("overlord_two_host");
- overlordTwoUrl = props.get("overlord_two_url");
- if (overlordTwoUrl == null) {
- overlordTwoUrl = StringUtils.format("http://%s:%s", overlordTwoHost, props.get("overlord_two_port"));
- }
- overlordTwoTLSUrl = props.get("overlord_two_tls_url");
- if (overlordTwoTLSUrl == null) {
- if (null != overlordTwoHost) {
- overlordTwoTLSUrl = StringUtils.format("https://%s:%s", overlordTwoHost, props.get("overlord_two_tls_port"));
- }
- }
-
- middleManagerHost = props.get("middlemanager_host");
-
- zookeeperHosts = props.get("zookeeper_hosts");
- kafkaHost = props.get("kafka_host") + ":" + props.get("kafka_port");
- schemaRegistryHost = props.get("schema_registry_host") + ":" + props.get("schema_registry_port");
-
- username = props.get("username");
-
- password = props.get("password");
-
- cloudBucket = props.get("cloud_bucket");
- cloudPath = props.get("cloud_path");
- cloudRegion = props.get("cloud_region");
- s3AssumeRoleWithExternalId = props.get("s3_assume_role_with_external_id");
- s3AssumeRoleExternalId = props.get("s3_assume_role_external_id");
- s3AssumeRoleWithoutExternalId = props.get("s3_assume_role_without_external_id");
-
- streamEndpoint = props.get("stream_endpoint");
-
- LOG.info("router: [%s], [%s]", routerUrl, routerTLSUrl);
- LOG.info("broker: [%s], [%s]", brokerUrl, brokerTLSUrl);
- LOG.info("historical: [%s], [%s]", historicalUrl, historicalTLSUrl);
- LOG.info("coordinator: [%s], [%s]", coordinatorUrl, coordinatorTLSUrl);
- LOG.info("overlord: [%s], [%s]", overlordUrl, overlordTLSUrl);
- LOG.info("middle manager: [%s]", middleManagerHost);
- LOG.info("zookeepers: [%s]", zookeeperHosts);
- LOG.info("kafka: [%s]", kafkaHost);
- LOG.info("Username: [%s]", username);
- }
-
- @Override
- public IntegrationTestingConfig get()
- {
- return new IntegrationTestingConfig()
- {
- @Override
- public String getCoordinatorUrl()
- {
- return coordinatorUrl;
- }
-
- @Override
- public String getCoordinatorTLSUrl()
- {
- return coordinatorTLSUrl;
- }
-
- @Override
- public String getCoordinatorTwoUrl()
- {
- return coordinatorTwoUrl;
- }
-
- @Override
- public String getCoordinatorTwoTLSUrl()
- {
- return coordinatorTwoTLSUrl;
- }
-
- @Override
- public String getOverlordUrl()
- {
- return overlordUrl;
- }
-
- @Override
- public String getOverlordTLSUrl()
- {
- return overlordTLSUrl;
- }
-
- @Override
- public String getOverlordTwoUrl()
- {
- return overlordTwoUrl;
- }
-
- @Override
- public String getOverlordTwoTLSUrl()
- {
- return overlordTwoTLSUrl;
- }
-
- @Override
- public String getIndexerUrl()
- {
- // no way to configure this since the config was stolen by the overlord
- return null;
- }
-
- @Override
- public String getIndexerTLSUrl()
- {
- // no way to configure this since the config was stolen by the overlord
- return null;
- }
-
- @Override
- public String getRouterUrl()
- {
- return routerUrl;
- }
-
- @Override
- public String getRouterTLSUrl()
- {
- return routerTLSUrl;
- }
-
- @Override
- public String getPermissiveRouterUrl()
- {
- return permissiveRouterUrl;
- }
-
- @Override
- public String getPermissiveRouterTLSUrl()
- {
- return permissiveRouterTLSUrl;
- }
-
- @Override
- public String getNoClientAuthRouterUrl()
- {
- return noClientAuthRouterUrl;
- }
-
- @Override
- public String getNoClientAuthRouterTLSUrl()
- {
- return noClientAuthRouterTLSUrl;
- }
-
- @Override
- public String getCustomCertCheckRouterUrl()
- {
- return customCertCheckRouterUrl;
- }
-
- @Override
- public String getCustomCertCheckRouterTLSUrl()
- {
- return customCertCheckRouterTLSUrl;
- }
-
- @Override
- public String getBrokerUrl()
- {
- return brokerUrl;
- }
-
- @Override
- public String getBrokerTLSUrl()
- {
- return brokerTLSUrl;
- }
-
- @Override
- public String getHistoricalUrl()
- {
- return historicalUrl;
- }
-
- @Override
- public String getHistoricalTLSUrl()
- {
- return historicalTLSUrl;
- }
-
- @Override
- public String getMiddleManagerHost()
- {
- return middleManagerHost;
- }
-
- @Override
- public String getHistoricalHost()
- {
- return historicalHost;
- }
-
- @Override
- public String getZookeeperHosts()
- {
- return zookeeperHosts;
- }
-
- @Override
- public String getKafkaHost()
- {
- return kafkaHost;
- }
-
- @Override
- public String getBrokerHost()
- {
- return brokerHost;
- }
-
- @Override
- public String getRouterHost()
- {
- return routerHost;
- }
-
- @Override
- public String getCoordinatorHost()
- {
- return coordinatorHost;
- }
-
- @Override
- public String getCoordinatorTwoHost()
- {
- return coordinatorTwoHost;
- }
-
- @Override
- public String getOverlordHost()
- {
- return overlordHost;
- }
-
- @Override
- public String getOverlordTwoHost()
- {
- return overlordTwoHost;
- }
-
- @Override
- public String getProperty(String keyword)
- {
- return props.get(keyword);
- }
-
- @Override
- public String getUsername()
- {
- return username;
- }
-
- @Override
- public String getPassword()
- {
- return password;
- }
-
- @Override
- public String getCloudBucket()
- {
- return cloudBucket;
- }
-
- @Override
- public String getCloudPath()
- {
- return cloudPath;
- }
-
- @Override
- public String getCloudRegion()
- {
- return cloudRegion;
- }
-
- @Override
- public String getS3AssumeRoleWithExternalId()
- {
- return s3AssumeRoleWithExternalId;
- }
-
- @Override
- public String getS3AssumeRoleExternalId()
- {
- return s3AssumeRoleExternalId;
- }
-
- @Override
- public String getS3AssumeRoleWithoutExternalId()
- {
- return s3AssumeRoleWithoutExternalId;
- }
-
- @Override
- public String getAzureKey()
- {
- return azureKey;
- }
-
- @Override
- public String getHadoopGcsCredentialsPath()
- {
- return hadoopGcsCredentialsPath;
- }
-
- @Override
- public String getStreamEndpoint()
- {
- return streamEndpoint;
- }
-
- @Override
- public String getSchemaRegistryHost()
- {
- return schemaRegistryHost;
- }
-
- @Override
- public Map<String, String> getProperties()
- {
- return props;
- }
-
- @Override
- public boolean manageKafkaTopic()
- {
- return Boolean.valueOf(props.getOrDefault("manageKafkaTopic", "true"));
- }
-
- @Override
- public String getExtraDatasourceNameSuffix()
- {
- return "";
- }
-
- @Override
- public boolean isDocker()
- {
- return false;
- }
- };
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CustomNodeRoleClientModule.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CustomNodeRoleClientModule.java
deleted file mode 100644
index df73a8c7d80..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/CustomNodeRoleClientModule.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import com.google.inject.Binder;
-import org.apache.druid.initialization.DruidModule;
-
-/**
- * Super-simple "client" for the custom node role which defines
- * the node role so that REST APIs and the system tables are
- * aware of this role.
- */
-public class CustomNodeRoleClientModule implements DruidModule
-{
- @Override
- public void configure(Binder binder)
- {
- // Not yet. Pending PR #12222
- // NodeRoles.addRole(binder, CliCustomNodeRole.NODE_ROLE);
- }
-
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/DockerConfigProvider.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/DockerConfigProvider.java
deleted file mode 100644
index f96f22bdea9..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/DockerConfigProvider.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import javax.annotation.Nullable;
-import javax.validation.constraints.NotNull;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The values here should be kept in sync with the values used in the docker-compose files used to bring up the
- * integration-test clusters.
- */
-public class DockerConfigProvider implements IntegrationTestingConfigProvider
-{
- @JsonProperty
- @NotNull
- private String dockerIp;
-
- @JsonProperty
- private String extraDatasourceNameSuffix = "";
-
- @JsonProperty
- private String cloudPath;
-
- @JsonProperty
- private String cloudBucket;
-
- @JsonProperty
- private String cloudRegion;
-
- @JsonProperty
- private String s3AssumeRoleWithExternalId;
-
- @JsonProperty
- private String s3AssumeRoleExternalId;
-
- @JsonProperty
- private String s3AssumeRoleWithoutExternalId;
-
- @JsonProperty
- private String hadoopGcsCredentialsPath;
-
- @JsonProperty
- private String azureKey;
-
- @JsonProperty
- private String streamEndpoint;
-
- @JsonProperty
- @JsonDeserialize(using = ArbitraryPropertiesJsonDeserializer.class)
- private Map<String, String> properties = new HashMap<>();
-
- @Override
- public IntegrationTestingConfig get()
- {
- return new IntegrationTestingConfig()
- {
- @Override
- public String getCoordinatorUrl()
- {
- return "http://" + dockerIp + ":8081";
- }
-
- @Override
- public String getCoordinatorTLSUrl()
- {
- return "https://" + dockerIp + ":8281";
- }
-
- @Override
- public String getCoordinatorTwoUrl()
- {
- return "http://" + dockerIp + ":8581";
- }
-
- @Override
- public String getCoordinatorTwoTLSUrl()
- {
- return "https://" + dockerIp + ":8781";
- }
-
- @Override
- public String getOverlordUrl()
- {
- return "http://" + dockerIp + ":8090";
- }
-
- @Override
- public String getOverlordTLSUrl()
- {
- return "https://" + dockerIp + ":8290";
- }
-
- @Override
- public String getOverlordTwoUrl()
- {
- return "http://" + dockerIp + ":8590";
- }
-
- @Override
- public String getOverlordTwoTLSUrl()
- {
- return "https://" + dockerIp + ":8790";
- }
-
- @Override
- public String getRouterUrl()
- {
- return "http://" + dockerIp + ":8888";
- }
-
- @Override
- public String getRouterTLSUrl()
- {
- return "https://" + dockerIp + ":9088";
- }
-
- @Override
- public String getPermissiveRouterUrl()
- {
- return "http://" + dockerIp + ":8889";
- }
-
- @Override
- public String getPermissiveRouterTLSUrl()
- {
- return "https://" + dockerIp + ":9089";
- }
-
- @Override
- public String getNoClientAuthRouterUrl()
- {
- return "http://" + dockerIp + ":8890";
- }
-
- @Override
- public String getNoClientAuthRouterTLSUrl()
- {
- return "https://" + dockerIp + ":9090";
- }
-
- @Override
- public String getCustomCertCheckRouterUrl()
- {
- return "http://" + dockerIp + ":8891";
- }
-
- @Override
- public String getCustomCertCheckRouterTLSUrl()
- {
- return "https://" + dockerIp + ":9091";
- }
-
- @Override
- public String getBrokerUrl()
- {
- return "http://" + dockerIp + ":8082";
- }
-
- @Override
- public String getBrokerTLSUrl()
- {
- return "https://" + dockerIp + ":8282";
- }
-
- @Override
- public String getHistoricalUrl()
- {
- return "http://" + dockerIp + ":8083";
- }
-
- @Override
- public String getHistoricalTLSUrl()
- {
- return "https://" + dockerIp + ":8283";
- }
-
- @Override
- public String getIndexerUrl()
- {
- return "http://" + dockerIp + ":8091";
- }
-
- @Override
- public String getIndexerTLSUrl()
- {
- return "https://" + dockerIp + ":8291";
- }
-
- @Override
- public String getMiddleManagerHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getHistoricalHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getBrokerHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getRouterHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getCoordinatorHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getCoordinatorTwoHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getOverlordHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getOverlordTwoHost()
- {
- return dockerIp;
- }
-
- @Override
- public String getZookeeperHosts()
- {
- return dockerIp + ":2181";
- }
-
- @Override
- public String getKafkaHost()
- {
- return dockerIp + ":9093";
- }
-
- @Override
- public String getZookeeperInternalHosts()
- {
- // docker container name
- return "druid-zookeeper-kafka:2181";
- }
-
- @Override
- public String getKafkaInternalHost()
- {
- // docker container name
- return "druid-zookeeper-kafka:9092";
- }
-
-
- @Override
- public String getBrokerInternalHost()
- {
- return "druid-broker";
- }
-
- @Override
- public String getRouterInternalHost()
- {
- return "druid-router";
- }
-
- @Override
- public String getCoordinatorInternalHost()
- {
- return "druid-coordinator";
- }
-
- @Override
- public String getCoordinatorTwoInternalHost()
- {
- return "druid-coordinator-two";
- }
-
- @Override
- public String getOverlordInternalHost()
- {
- return "druid-overlord";
- }
-
- @Override
- public String getOverlordTwoInternalHost()
- {
- return "druid-overlord-two";
- }
-
- @Override
- public String getHistoricalInternalHost()
- {
- return "druid-historical";
- }
-
- @Override
- public String getSchemaRegistryHost()
- {
- return dockerIp + ":8085";
- }
-
- @Override
- public String getSchemaRegistryInternalHost()
- {
- return "schema-registry:8085";
- }
-
- @Override
- public String getProperty(String prop)
- {
- return properties.get(prop);
- }
-
- @Override
- public String getUsername()
- {
- return null;
- }
-
- @Override
- public String getPassword()
- {
- return null;
- }
-
- @Override
- public Map<String, String> getProperties()
- {
- return properties;
- }
-
- @Override
- public boolean manageKafkaTopic()
- {
- return true;
- }
-
- @Override
- public String getExtraDatasourceNameSuffix()
- {
- return extraDatasourceNameSuffix;
- }
-
- @Override
- public String getCloudBucket()
- {
- return cloudBucket;
- }
-
- @Override
- public String getCloudPath()
- {
- return cloudPath;
- }
-
- @Override
- public String getCloudRegion()
- {
- return cloudRegion;
- }
-
- @Override
- public String getS3AssumeRoleWithExternalId()
- {
- return s3AssumeRoleWithExternalId;
- }
-
- @Override
- public String getS3AssumeRoleExternalId()
- {
- return s3AssumeRoleExternalId;
- }
-
- @Override
- public String getS3AssumeRoleWithoutExternalId()
- {
- return s3AssumeRoleWithoutExternalId;
- }
-
- @Override
- public String getAzureKey()
- {
- return azureKey;
- }
-
- @Override
- public String getHadoopGcsCredentialsPath()
- {
- return hadoopGcsCredentialsPath;
- }
-
- @Override
- public String getStreamEndpoint()
- {
- return streamEndpoint;
- }
-
- @Override
- public boolean isDocker()
- {
- return true;
- }
-
- @Override
- @Nullable
- public String getDockerHost()
- {
- return dockerIp;
- }
- };
- }
-
- // there is probably a better way to do this...
- static class ArbitraryPropertiesJsonDeserializer extends JsonDeserializer<Map<String, String>>
- {
- @Override
- public Map<String, String> deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
- throws IOException
- {
- // given some config input, such as
- // druid.test.config.properites.a.b.c=d
- // calling jsonParser.readValueAs(Map.class) here results in a map that has both nested objects and also
- // flattened string pairs, so the map looks something like this (in JSON form):
- // {
- // "a" : { "b": { "c" : "d" }}},
- // "a.b.c":"d"
- // }
- // The string pairs are the values we want to populate this map with, so filtering out the top level keys which
- // do not have string values leaves us with
- // { "a.b.c":"d"}
- // from the given example, which is what we want
- Map<String, Object> parsed = jsonParser.readValueAs(Map.class);
- Map<String, String> flat = new HashMap<>();
- for (Map.Entry<String, Object> entry : parsed.entrySet()) {
- if (!(entry.getValue() instanceof Map)) {
- flat.put(entry.getKey(), (String) entry.getValue());
- }
- }
- return flat;
- }
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/IntegrationTestingConfig.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/IntegrationTestingConfig.java
deleted file mode 100644
index 7a3e4d678fa..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/IntegrationTestingConfig.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import javax.annotation.Nullable;
-import java.util.Map;
-
-/**
- * Configuration for tests. Opinionated about the shape of the cluster:
- * there is one or two Coordinators or Overlords, zero or one of
- * everything else.
- * <p>
- * To work in Docker (and K8s) there are two methods per host:
- * {@code get<service>Host()} which returns the host as seen from
- * the test machine (meaning the proxy host), and
- * {@code get<service>InternalHost()} which returns the name of
- * the host as seen by itself and other services: the host published
- * in ZK, which is the host known to the Docker/K8s overlay network.
- * <p>
- * The {@code get<service>Url()} methods return URLs relative to
- * the test, using the proxy host for Docker and K8s.
- */
-public interface IntegrationTestingConfig
-{
- String getZookeeperHosts();
-
- default String getZookeeperInternalHosts()
- {
- return getZookeeperHosts();
- }
-
- String getKafkaHost();
-
- default String getKafkaInternalHost()
- {
- return getKafkaHost();
- }
-
- String getBrokerHost();
-
- default String getBrokerInternalHost()
- {
- return getBrokerHost();
- }
-
- String getRouterHost();
-
- default String getRouterInternalHost()
- {
- return getRouterHost();
- }
-
- String getCoordinatorHost();
-
- default String getCoordinatorInternalHost()
- {
- return getCoordinatorHost();
- }
-
- String getCoordinatorTwoHost();
-
- default String getCoordinatorTwoInternalHost()
- {
- return getCoordinatorTwoHost();
- }
-
- String getOverlordHost();
-
- default String getOverlordInternalHost()
- {
- return getOverlordHost();
- }
-
- String getOverlordTwoHost();
-
- default String getOverlordTwoInternalHost()
- {
- return getOverlordTwoHost();
- }
-
- String getMiddleManagerHost();
-
- default String getMiddleManagerInternalHost()
- {
- return getMiddleManagerHost();
- }
-
- String getHistoricalHost();
-
- default String getHistoricalInternalHost()
- {
- return getHistoricalHost();
- }
-
- String getCoordinatorUrl();
-
- String getCoordinatorTLSUrl();
-
- String getCoordinatorTwoUrl();
-
- String getCoordinatorTwoTLSUrl();
-
- String getOverlordUrl();
-
- String getOverlordTLSUrl();
-
- String getOverlordTwoUrl();
-
- String getOverlordTwoTLSUrl();
-
- String getIndexerUrl();
-
- String getIndexerTLSUrl();
-
- String getRouterUrl();
-
- String getRouterTLSUrl();
-
- String getPermissiveRouterUrl();
-
- String getPermissiveRouterTLSUrl();
-
- String getNoClientAuthRouterUrl();
-
- String getNoClientAuthRouterTLSUrl();
-
- String getCustomCertCheckRouterUrl();
-
- String getCustomCertCheckRouterTLSUrl();
-
- String getBrokerUrl();
-
- String getBrokerTLSUrl();
-
- String getHistoricalUrl();
-
- String getHistoricalTLSUrl();
-
- String getProperty(String prop);
-
- String getUsername();
-
- String getPassword();
-
- Map<String, String> getProperties();
-
- boolean manageKafkaTopic();
-
- String getExtraDatasourceNameSuffix();
-
- String getCloudBucket();
-
- String getCloudPath();
-
- String getCloudRegion();
-
- String getS3AssumeRoleWithExternalId();
-
- String getS3AssumeRoleExternalId();
-
- String getS3AssumeRoleWithoutExternalId();
-
- String getAzureKey();
-
- String getHadoopGcsCredentialsPath();
-
- String getStreamEndpoint();
-
- String getSchemaRegistryHost();
-
- default String getSchemaRegistryInternalHost()
- {
- return getSchemaRegistryHost();
- }
-
- boolean isDocker();
-
- @Nullable
- default String getDockerHost()
- {
- return null;
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/IntegrationTestingConfigProvider.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/IntegrationTestingConfigProvider.java
deleted file mode 100644
index 2c647bec369..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/IntegrationTestingConfigProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.google.inject.Provider;
-
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = DockerConfigProvider.class)
-@JsonSubTypes(value = {
- @JsonSubTypes.Type(name = "docker", value = DockerConfigProvider.class),
- @JsonSubTypes.Type(name = "configFile", value = ConfigFileConfigProvider.class)
-})
-public interface IntegrationTestingConfigProvider extends Provider<IntegrationTestingConfig>
-{
- String PROPERTY_BASE = "druid.test.config";
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/KafkaEventWriter.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/KafkaEventWriter.java
deleted file mode 100644
index a62b344fe62..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/KafkaEventWriter.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import org.apache.druid.common.utils.IdUtils;
-import org.apache.kafka.clients.producer.KafkaProducer;
-import org.apache.kafka.clients.producer.ProducerRecord;
-import org.apache.kafka.clients.producer.RecordMetadata;
-import org.apache.kafka.common.serialization.ByteArraySerializer;
-import org.apache.kafka.common.serialization.StringSerializer;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-public class KafkaEventWriter implements StreamEventWriter
-{
- private final KafkaProducer<String, byte[]> producer;
- private final boolean txnEnabled;
- private final List<Future<RecordMetadata>> pendingWriteRecords = new ArrayList<>();
-
- public KafkaEventWriter(Map<String, String> properties, boolean txnEnabled)
- {
- this.txnEnabled = txnEnabled;
- Properties kafkaProperties = new Properties();
- kafkaProperties.putAll(properties);
- kafkaProperties.setProperty("acks", "all");
- kafkaProperties.setProperty("retries", "3");
- kafkaProperties.setProperty("key.serializer", ByteArraySerializer.class.getName());
- kafkaProperties.setProperty("value.serializer", ByteArraySerializer.class.getName());
- if (txnEnabled) {
- kafkaProperties.setProperty("enable.idempotence", "true");
- kafkaProperties.setProperty("transactional.id", IdUtils.getRandomId());
- }
- this.producer = new KafkaProducer<>(kafkaProperties);
- if (txnEnabled) {
- producer.initTransactions();
- }
- }
-
- public KafkaEventWriter(IntegrationTestingConfig config, boolean txnEnabled)
- {
- Properties properties = new Properties();
- properties.setProperty("bootstrap.servers", config.getKafkaHost());
- properties.setProperty("acks", "all");
- properties.setProperty("retries", "3");
- properties.setProperty("key.serializer", ByteArraySerializer.class.getName());
- properties.setProperty("value.serializer", ByteArraySerializer.class.getName());
- this.txnEnabled = txnEnabled;
- if (txnEnabled) {
- properties.setProperty("enable.idempotence", "true");
- properties.setProperty("transactional.id", IdUtils.getRandomId());
- }
- KafkaUtil.addPropertiesFromTestConfig(config, properties);
- this.producer = new KafkaProducer<>(
- properties,
- new StringSerializer(),
- new ByteArraySerializer()
- );
- if (txnEnabled) {
- producer.initTransactions();
- }
- }
-
- @Override
- public boolean supportTransaction()
- {
- return true;
- }
-
- @Override
- public boolean isTransactionEnabled()
- {
- return txnEnabled;
- }
-
- @Override
- public void initTransaction()
- {
- if (txnEnabled) {
- producer.beginTransaction();
- } else {
- throw new IllegalStateException("Kafka writer was initialized with transaction disabled");
- }
- }
-
- @Override
- public void commitTransaction()
- {
- if (txnEnabled) {
- producer.commitTransaction();
- } else {
- throw new IllegalStateException("Kafka writer was initialized with transaction disabled");
- }
- }
-
- @Override
- public void write(String topic, byte[] event)
- {
- Future<RecordMetadata> future = producer.send(new ProducerRecord<>(topic, event));
- pendingWriteRecords.add(future);
- }
-
- @Override
- public void close()
- {
- flush();
- producer.close();
- }
-
- @Override
- public void flush()
- {
- Exception e = null;
- for (Future<RecordMetadata> future : pendingWriteRecords) {
- try {
- future.get();
- }
- catch (InterruptedException | ExecutionException ex) {
- if (ex instanceof InterruptedException) {
- Thread.currentThread().interrupt();
- }
- if (e == null) {
- e = ex;
- } else {
- e.addSuppressed(ex);
- }
- }
- }
- pendingWriteRecords.clear();
- if (e != null) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/KafkaUtil.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/KafkaUtil.java
deleted file mode 100644
index 98b8bf8a2ac..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/KafkaUtil.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient;
-import org.apache.druid.java.util.common.StringUtils;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public class KafkaUtil
-{
- private static final String TEST_PROPERTY_PREFIX = "kafka.test.property.";
- private static final String TEST_CONFIG_PROPERTY_PREFIX = "kafka.test.config.";
-
- public static final String TEST_CONFIG_TRANSACTION_ENABLED = "transactionEnabled";
-
- public static void addPropertiesFromTestConfig(IntegrationTestingConfig config, Properties properties)
- {
- for (Map.Entry<String, String> entry : config.getProperties().entrySet()) {
- if (entry.getKey().startsWith(TEST_PROPERTY_PREFIX)) {
- properties.setProperty(entry.getKey().substring(TEST_PROPERTY_PREFIX.length()), entry.getValue());
- }
- }
- }
-
- public static Map<String, String> getAdditionalKafkaTestConfigFromProperties(IntegrationTestingConfig config)
- {
- Map<String, String> theMap = new HashMap<>();
- for (Map.Entry<String, String> entry : config.getProperties().entrySet()) {
- if (entry.getKey().startsWith(TEST_CONFIG_PROPERTY_PREFIX)) {
- theMap.put(entry.getKey().substring(TEST_CONFIG_PROPERTY_PREFIX.length()), entry.getValue());
- }
- }
- return theMap;
- }
-
- public static CachedSchemaRegistryClient createSchemaRegistryClient(String schemaRegistryHost)
- {
- return new CachedSchemaRegistryClient(
- StringUtils.format("http://%s", schemaRegistryHost),
- Integer.MAX_VALUE,
- Map.of(
- "basic.auth.credentials.source", "USER_INFO",
- "basic.auth.user.info", "druid:diurd"
- ),
- Map.of()
- );
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/QueryRetryTestCommandCreator.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/QueryRetryTestCommandCreator.java
deleted file mode 100644
index 4fdd9e9d2da..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/QueryRetryTestCommandCreator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import com.github.rvesse.airline.builder.CliBuilder;
-import org.apache.druid.cli.CliCommandCreator;
-
-public class QueryRetryTestCommandCreator implements CliCommandCreator
-{
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addCommands(CliBuilder builder)
- {
- builder.withGroup("server").withCommands(CliHistoricalForQueryErrorTest.class);
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ServerManagerForQueryErrorTest.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ServerManagerForQueryErrorTest.java
deleted file mode 100644
index b39b567dd58..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/ServerManagerForQueryErrorTest.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
-import org.apache.commons.lang3.mutable.MutableBoolean;
-import org.apache.druid.client.cache.Cache;
-import org.apache.druid.client.cache.CacheConfig;
-import org.apache.druid.client.cache.CachePopulator;
-import org.apache.druid.error.DruidException;
-import org.apache.druid.guice.annotations.Smile;
-import org.apache.druid.java.util.common.guava.Accumulator;
-import org.apache.druid.java.util.common.guava.FunctionalIterable;
-import org.apache.druid.java.util.common.guava.Sequence;
-import org.apache.druid.java.util.common.guava.Sequences;
-import org.apache.druid.java.util.common.guava.Yielder;
-import org.apache.druid.java.util.common.guava.YieldingAccumulator;
-import org.apache.druid.java.util.common.logger.Logger;
-import org.apache.druid.java.util.emitter.service.ServiceEmitter;
-import org.apache.druid.query.DataSegmentAndDescriptor;
-import org.apache.druid.query.LeafSegmentsBundle;
-import org.apache.druid.query.Query;
-import org.apache.druid.query.QueryCapacityExceededException;
-import org.apache.druid.query.QueryContext;
-import org.apache.druid.query.QueryProcessingPool;
-import org.apache.druid.query.QueryRunner;
-import org.apache.druid.query.QueryRunnerFactory;
-import org.apache.druid.query.QueryRunnerFactoryConglomerate;
-import org.apache.druid.query.QueryTimeoutException;
-import org.apache.druid.query.QueryToolChest;
-import org.apache.druid.query.QueryUnsupportedException;
-import org.apache.druid.query.ResourceLimitExceededException;
-import org.apache.druid.query.SegmentDescriptor;
-import org.apache.druid.query.planning.ExecutionVertex;
-import org.apache.druid.query.policy.NoopPolicyEnforcer;
-import org.apache.druid.segment.Segment;
-import org.apache.druid.segment.SegmentMapFunction;
-import org.apache.druid.segment.SegmentReference;
-import org.apache.druid.server.SegmentManager;
-import org.apache.druid.server.ServerManager;
-import org.apache.druid.server.initialization.ServerConfig;
-import org.apache.druid.timeline.DataSegment;
-import org.apache.druid.timeline.VersionedIntervalTimeline;
-import org.apache.druid.timeline.partition.PartitionChunk;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * This server manager is designed to test various query failures.
- * <ul>
- * <li> Missing segments. A segment can be missing during a query if a historical drops the segment
- * after the broker issues the query to the historical. To mimic this situation, the historical
- * with this server manager announces all segments assigned, and reports missing segments based on the following:
- * <ul>
- * <li> If {@link #QUERY_RETRY_UNAVAILABLE_SEGMENT_IDX_KEY} and {@link #QUERY_RETRY_TEST_CONTEXT_KEY} are set,
- * the segment at that index is reported as missing exactly once.</li>
- * <li> If {@link #QUERY_RETRY_UNAVAILABLE_SEGMENT_IDX_KEY} is not set or is -1, it simulates missing segments
- * starting from the beginning, up to {@link #MAX_NUM_FALSE_MISSING_SEGMENTS_REPORTS}.</li>
- * </ul>
- * The missing report is only generated once for the first time. Post that report, upon retry, all segments are served
- * for the datasource. See ITQueryRetryTestOnMissingSegments. </li>
- * <li> Other query errors. This server manager returns a sequence that always throws an exception
- * based on a given query context value. See ITQueryErrorTest. </li>
- * </ul>
- *
- * @see org.apache.druid.query.RetryQueryRunner for query retrying.
- * @see org.apache.druid.client.JsonParserIterator for handling query errors from historicals.
- */
-public class ServerManagerForQueryErrorTest extends ServerManager
-{
- // Query context key that indicates this query is for query retry testing.
- public static final String QUERY_RETRY_TEST_CONTEXT_KEY = "query-retry-test";
- public static final String QUERY_TIMEOUT_TEST_CONTEXT_KEY = "query-timeout-test";
- public static final String QUERY_CAPACITY_EXCEEDED_TEST_CONTEXT_KEY = "query-capacity-exceeded-test";
- public static final String QUERY_UNSUPPORTED_TEST_CONTEXT_KEY = "query-unsupported-test";
- public static final String RESOURCE_LIMIT_EXCEEDED_TEST_CONTEXT_KEY = "resource-limit-exceeded-test";
- public static final String QUERY_FAILURE_TEST_CONTEXT_KEY = "query-failure-test";
- /**
- * Query context that indicates which segment should be marked as unavilable/missing.
- * This should be used in conjunction with {@link #QUERY_RETRY_TEST_CONTEXT_KEY}.
- * <p>
- * A value of {@code 0} means the first segment will be reported as missing, {@code 1} for the second, and so on.
- * If this key is not set (default = -1), the test will instead simulate missing up to
- * {@link #MAX_NUM_FALSE_MISSING_SEGMENTS_REPORTS} segments from the beginning.
- * </p>
- */
- public static final String QUERY_RETRY_UNAVAILABLE_SEGMENT_IDX_KEY = "unavailable-segment-idx";
- private static final int MAX_NUM_FALSE_MISSING_SEGMENTS_REPORTS = 1;
-
- private static final Logger LOG = new Logger(ServerManagerForQueryErrorTest.class);
-
- private final ConcurrentHashMap<String, Integer> queryToIgnoredSegments = new ConcurrentHashMap<>();
-
- @Inject
- public ServerManagerForQueryErrorTest(
- QueryRunnerFactoryConglomerate conglomerate,
- ServiceEmitter emitter,
- QueryProcessingPool queryProcessingPool,
- CachePopulator cachePopulator,
- @Smile ObjectMapper objectMapper,
- Cache cache,
- CacheConfig cacheConfig,
- SegmentManager segmentManager,
- ServerConfig serverConfig
- )
- {
- super(
- conglomerate,
- emitter,
- queryProcessingPool,
- cachePopulator,
- objectMapper,
- cache,
- cacheConfig,
- segmentManager,
- serverConfig,
- NoopPolicyEnforcer.instance()
- );
- }
-
- @Override
- public <T> QueryRunner<T> getQueryRunnerForSegments(Query<T> query, Iterable<SegmentDescriptor> specs)
- {
- final ExecutionVertex ev = ExecutionVertex.of(query);
- final Optional<VersionedIntervalTimeline<String, DataSegment>> maybeTimeline =
- segmentManager.getTimeline(ev.getBaseTableDataSource());
- if (maybeTimeline.isEmpty()) {
- return (queryPlus, responseContext) -> {
- responseContext.addMissingSegments(Lists.newArrayList(specs));
- return Sequences.empty();
- };
- }
-
- final QueryRunnerFactory<T, Query<T>> factory = getQueryRunnerFactory(query);
- final QueryToolChest<T, Query<T>> toolChest = getQueryToolChest(query, factory);
- final VersionedIntervalTimeline<String, DataSegment> timeline = maybeTimeline.get();
-
- return new ResourceManagingQueryRunner<>(timeline, factory, toolChest, ev, specs)
- {
- @Override
- protected LeafSegmentsBundle getLeafSegmentsBundle(Query<T> query, SegmentMapFunction segmentMapFunction)
- {
- // override this method so that we can artifically create missing segments
- final List<DataSegmentAndDescriptor> segments = new ArrayList<>();
- final ArrayList<SegmentDescriptor> missingSegments = new ArrayList<>();
- final ArrayList<SegmentReference> segmentReferences = new ArrayList<>();
- final ArrayList<DataSegmentAndDescriptor> loadableSegments = new ArrayList<>();
-
- final QueryContext queryContext = query.context();
-
- for (SegmentDescriptor descriptor : specs) {
- final MutableBoolean isIgnoreSegment = new MutableBoolean(false);
- if (queryContext.getBoolean(QUERY_RETRY_TEST_CONTEXT_KEY, false)) {
- final int unavailableSegmentIdx = queryContext.getInt(QUERY_RETRY_UNAVAILABLE_SEGMENT_IDX_KEY, -1);
- queryToIgnoredSegments.compute(
- query.getMostSpecificId(),
- (queryId, ignoreCounter) -> {
- if (ignoreCounter == null) {
- ignoreCounter = 0;
- }
-
- if (unavailableSegmentIdx >= 0 && unavailableSegmentIdx == ignoreCounter) {
- // Fail exactly once when counter matches the configured retry index
- ignoreCounter++;
- isIgnoreSegment.setTrue();
- } else if (ignoreCounter < MAX_NUM_FALSE_MISSING_SEGMENTS_REPORTS) {
- // Fail up to N times for this query
- ignoreCounter++;
- isIgnoreSegment.setTrue();
- }
- return ignoreCounter;
- }
- );
-
- if (isIgnoreSegment.isTrue()) {
- LOG.info(
- "Pretending I don't have segment[%s]",
- descriptor
- );
- missingSegments.add(descriptor);
- continue;
- }
- }
-
- final PartitionChunk<DataSegment> chunk = timeline.findChunk(
- descriptor.getInterval(),
- descriptor.getVersion(),
- descriptor.getPartitionNumber()
- );
-
- if (chunk != null) {
- segments.add(new DataSegmentAndDescriptor(chunk.getObject(), descriptor));
- } else {
- missingSegments.add(descriptor);
- }
- }
-
- // inlined logic of ServerManager.getSegmentsBundle
- for (DataSegmentAndDescriptor segment : segments) {
- final DataSegment dataSegment = segment.getDataSegment();
- if (dataSegment == null) {
- missingSegments.add(segment.getDescriptor());
- continue;
- }
- Optional<Segment> ref = segmentManager.acquireCachedSegment(dataSegment);
- if (ref.isPresent()) {
- segmentReferences.add(
- new SegmentReference(
- segment.getDescriptor(),
- segmentMapFunction.apply(ref),
- null
- )
- );
- } else if (segmentManager.canLoadSegmentOnDemand(dataSegment)) {
- loadableSegments.add(segment);
- } else {
- missingSegments.add(segment.getDescriptor());
- }
- }
- return new LeafSegmentsBundle(segmentReferences, loadableSegments, missingSegments);
- }
- };
- }
-
- @Override
- protected <T> FunctionalIterable<QueryRunner<T>> getQueryRunnersForSegments(
- Query<T> query,
- QueryRunnerFactory<T, Query<T>> factory,
- QueryToolChest<T, Query<T>> toolChest,
- List<SegmentReference> segmentReferences,
- AtomicLong cpuTimeAccumulator,
- Optional<byte[]> cacheKeyPrefix
- )
- {
- return FunctionalIterable
- .create(segmentReferences)
- .transform(
- ref ->
- ref.getSegmentReference()
- .map(segment -> {
- final QueryContext queryContext = query.context();
- if (queryContext.getBoolean(QUERY_TIMEOUT_TEST_CONTEXT_KEY, false)) {
- return (QueryRunner<T>) (queryPlus, responseContext) -> new Sequence<>()
- {
- @Override
- public <OutType> OutType accumulate(
- OutType initValue,
- Accumulator<OutType, T> accumulator
- )
- {
- throw new QueryTimeoutException("query timeout test");
- }
-
- @Override
- public <OutType> Yielder<OutType> toYielder(
- OutType initValue,
- YieldingAccumulator<OutType, T> accumulator
- )
- {
- throw new QueryTimeoutException("query timeout test");
- }
- };
- } else if (queryContext.getBoolean(QUERY_CAPACITY_EXCEEDED_TEST_CONTEXT_KEY, false)) {
- return (QueryRunner<T>) (queryPlus, responseContext) -> new Sequence<>()
- {
- @Override
- public <OutType> OutType accumulate(
- OutType initValue,
- Accumulator<OutType, T> accumulator
- )
- {
- throw QueryCapacityExceededException.withErrorMessageAndResolvedHost(
- "query capacity exceeded test"
- );
- }
-
- @Override
- public <OutType> Yielder<OutType> toYielder(
- OutType initValue,
- YieldingAccumulator<OutType, T> accumulator
- )
- {
- throw QueryCapacityExceededException.withErrorMessageAndResolvedHost(
- "query capacity exceeded test"
- );
- }
- };
- } else if (queryContext.getBoolean(QUERY_UNSUPPORTED_TEST_CONTEXT_KEY, false)) {
- return (QueryRunner<T>) (queryPlus, responseContext) -> new Sequence<>()
- {
- @Override
- public <OutType> OutType accumulate(
- OutType initValue,
- Accumulator<OutType, T> accumulator
- )
- {
- throw new QueryUnsupportedException("query unsupported test");
- }
-
- @Override
- public <OutType> Yielder<OutType> toYielder(
- OutType initValue,
- YieldingAccumulator<OutType, T> accumulator
- )
- {
- throw new QueryUnsupportedException("query unsupported test");
- }
- };
- } else if (queryContext.getBoolean(RESOURCE_LIMIT_EXCEEDED_TEST_CONTEXT_KEY, false)) {
- return (QueryRunner<T>) (queryPlus, responseContext) -> new Sequence<>()
- {
- @Override
- public <OutType> OutType accumulate(
- OutType initValue,
- Accumulator<OutType, T> accumulator
- )
- {
- throw new ResourceLimitExceededException("resource limit exceeded test");
- }
-
- @Override
- public <OutType> Yielder<OutType> toYielder(
- OutType initValue,
- YieldingAccumulator<OutType, T> accumulator
- )
- {
- throw new ResourceLimitExceededException("resource limit exceeded test");
- }
- };
- } else if (queryContext.getBoolean(QUERY_FAILURE_TEST_CONTEXT_KEY, false)) {
- return (QueryRunner<T>) (queryPlus, responseContext) -> new Sequence<>()
- {
- @Override
- public <OutType> OutType accumulate(
- OutType initValue,
- Accumulator<OutType, T> accumulator
- )
- {
- throw new RuntimeException("query failure test");
- }
-
- @Override
- public <OutType> Yielder<OutType> toYielder(
- OutType initValue,
- YieldingAccumulator<OutType, T> accumulator
- )
- {
- throw new RuntimeException("query failure test");
- }
- };
- }
-
- return buildQueryRunnerForSegment(
- ref.getSegmentDescriptor(),
- segment,
- factory,
- toolChest,
- cpuTimeAccumulator,
- cacheKeyPrefix
- );
- })
- .orElseThrow(
- () -> DruidException.defensive("Unexpected missing segment[%s]", ref.getSegmentDescriptor())
- )
- );
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SleepExprMacro.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SleepExprMacro.java
deleted file mode 100644
index 85d00f2d65e..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SleepExprMacro.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import org.apache.druid.math.expr.Expr;
-import org.apache.druid.math.expr.ExprEval;
-import org.apache.druid.math.expr.ExprMacroTable;
-import org.apache.druid.math.expr.ExprMacroTable.ExprMacro;
-import org.apache.druid.math.expr.ExpressionType;
-
-import java.util.List;
-
-/**
- * This function makes the current thread sleep for the given amount of seconds.
- * Fractional-second delays can be specified.
- *
- * This function is applied per row. The actual query time can vary depending on how much parallelism is used
- * for the query. As it does not provide consistent sleep time, this function should be used only for testing
- * when you want to keep a certain query running during the test.
- */
-public class SleepExprMacro implements ExprMacro
-{
- private static final String NAME = "sleep";
-
- @Override
- public String name()
- {
- return NAME;
- }
-
- @Override
- public Expr apply(List<Expr> args)
- {
- validationHelperCheckArgumentCount(args, 1);
-
- Expr arg = args.get(0);
-
- class SleepExpr extends ExprMacroTable.BaseScalarMacroFunctionExpr
- {
- public SleepExpr(List<Expr> args)
- {
- super(SleepExprMacro.this, args);
- }
-
- @Override
- public ExprEval eval(ObjectBinding bindings)
- {
- ExprEval eval = arg.eval(bindings);
- try {
- if (!eval.isNumericNull()) {
- double seconds = eval.asDouble(); // double to support fractional-second.
- if (seconds > 0) {
- Thread.sleep((long) (seconds * 1000));
- }
- }
- return ExprEval.ofMissing();
- }
- catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw processingFailed(e, "interrupted");
- }
- }
-
- /**
- * Explicitly override this method to not vectorize the sleep expression.
- * If we ever want to vectorize this expression, {@link #getOutputType} should be considered to return something
- * else than just null.
- */
- @Override
- public boolean canVectorize(InputBindingInspector inspector)
- {
- return false;
- }
-
- @Override
- public ExpressionType getOutputType(InputBindingInspector inspector)
- {
- return null;
- }
- }
- return new SleepExpr(args);
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SleepOperatorConversion.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SleepOperatorConversion.java
deleted file mode 100644
index abc31d3a434..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/SleepOperatorConversion.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.druid.testing.tools;
-
-import org.apache.calcite.rex.RexNode;
-import org.apache.calcite.sql.SqlFunction;
-import org.apache.calcite.sql.SqlFunctionCategory;
-import org.apache.calcite.sql.SqlOperator;
-import org.apache.calcite.sql.type.SqlTypeFamily;
-import org.apache.calcite.sql.type.SqlTypeName;
-import org.apache.druid.segment.column.RowSignature;
-import org.apache.druid.sql.calcite.expression.DruidExpression;
-import org.apache.druid.sql.calcite.expression.OperatorConversions;
-import org.apache.druid.sql.calcite.expression.SqlOperatorConversion;
-import org.apache.druid.sql.calcite.planner.PlannerContext;
-
-import javax.annotation.Nullable;
-
-/**
- * A SQL operator conversion for the {@link SleepExprMacro} expression.
- * The expression is evaluated during the query planning when the given argument is a number literal.
- */
-public class SleepOperatorConversion implements SqlOperatorConversion
-{
- private static final SqlFunction SQL_FUNCTION = OperatorConversions
- .operatorBuilder("SLEEP")
- .operandTypes(SqlTypeFamily.NUMERIC)
- .requiredOperandCount(1)
- .returnTypeNullable(SqlTypeName.VARCHAR) // always null
- .functionCategory(SqlFunctionCategory.TIMEDATE)
- .build();
-
- @Override
- public SqlOperator calciteOperator()
- {
- return SQL_FUNCTION;
- }
-
- @Nullable
- @Override
- public DruidExpression toDruidExpression(PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode)
- {
- return OperatorConversions.convertDirectCall(plannerContext, rowSignature, rexNode, "sleep");
- }
-}
diff --git a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/package.java b/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/package.java
deleted file mode 100644
index 74930f7abbd..00000000000
--- a/integration-tests-ex/tools/src/main/java/org/apache/druid/testing/tools/package.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * Code loaded into a test Druid server for integration testing.
- *
- * Code here is excluded from Jacoco inspections.
- */
-package org.apache.druid.testing.tools;
diff --git a/integration-tests-ex/tools/src/main/resources/META-INF/services/org.apache.druid.cli.CliCommandCreator b/integration-tests-ex/tools/src/main/resources/META-INF/services/org.apache.druid.cli.CliCommandCreator
deleted file mode 100644
index c9b692c39c6..00000000000
--- a/integration-tests-ex/tools/src/main/resources/META-INF/services/org.apache.druid.cli.CliCommandCreator
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-org.apache.druid.testing.tools.QueryRetryTestCommandCreator
diff --git a/integration-tests-ex/tools/src/main/resources/META-INF/services/org.apache.druid.initialization.DruidModule b/integration-tests-ex/tools/src/main/resources/META-INF/services/org.apache.druid.initialization.DruidModule
deleted file mode 100644
index 3559697aea5..00000000000
--- a/integration-tests-ex/tools/src/main/resources/META-INF/services/org.apache.druid.initialization.DruidModule
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-org.apache.druid.testing.tools.CustomNodeRoleClientModule
\ No newline at end of file
diff --git a/it.sh b/it.sh
deleted file mode 100755
index 2e13329a14a..00000000000
--- a/it.sh
+++ /dev/null
@@ -1,316 +0,0 @@
-#! /bin/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.
-#--------------------------------------------------------------------
-
-# Utility script for running the new integration tests, since the Maven
-# commands are unwieldy. Allows straightforward usage of ITs on the desktop
-# and in various build scripts. Handles configuration of various kinds.
-
-set -e
-
-# Enable for debugging
-#set -x
-
-export DRUID_DEV=$(cd $(dirname $0) && pwd)
-
-function usage
-{
- cat <<EOF
-Usage: $0 cmd [category] [module]
- ci
- build Druid and the distribution for CI pipelines
- build
- Build Druid and the distribution
- dist
- Build the Druid distribution (only)
- tools
- Build druid-it-tools
- image
- Build the test image
- up <category> [<module>]
- Start the cluster for category.
- down <category> [<module>]
- Stop the cluster for category.
- run <category> [<module>]
- Run the tests for the given module on an alread-running cluster.
- Does not stop the cluster. Primarily for debugging.
- test <category> [<module>]
- Start the cluster, run the test for category, and stop the cluster.
- tail <category> [<module>]
- Show the last 20 lines of each container log.
- gen <category> [<module>]
- Generate docker-compose.yaml files (done automatically on up)
- run one IT in Travis (build dist, image, run test, tail logs).
- github <category> [<module>]
- Run one IT in Github Workflows (run test, tail logs).
- prune-containers
- Stop all running Docker containers. Do this if "down" won't work
- because the "docker-compose.yaml" file is no longer available.
- prune-volumes
- prune Docker volumes.
-
-Arguments:
- category: A defined IT JUnit category, and IT-<category> profile
- module: relative path to the module with tests. Defaults to
- integration-tests-ex/cases
-
-Environment:
- OVERRIDE_ENV: optional, name of env file to pass to Docker
- USE_INDEXER: Set to middleManager (default if not set)
- or "indexer". If "indexer", requires docker-compose-indexer.yaml exist.
- druid_*: passed to the container.
- Other, test-specific variables.
-
-See docs for additional details.
-EOF
-}
-
-function tail_logs
-{
- pushd $MODULE_DIR/target/$CATEGORY/logs > /dev/null
- ls *.log | while read log;
- do
- echo "----- $CATEGORY/$log -----"
- tail -100 $log
- done
- popd > /dev/null
-}
-
-# Many tests require us to pass information into containers using environment variables.
-# The Docker environment is distinct from the environment running this script. We bridge
-# the two by passing into Docker compose a file that contains all env vars we want to
-# "export" from our local environment into the container environment.
-# There are three ways to provide these options:
-#
-# 1. Directly in the environment. (Simplest and best.) We support a fixed set of variables:
-# <need the list>
-# 2. For ad-hoc use, as var=value pairs in a file with the same name as the
-# test catagory, in the home folder under ~/druid-it. Example:
-# BatchIndex.env. Use this to hold credentials and other info which you must
-# pass into tests when running locally.
-# 3. A file given by the OVERRIDE_ENV environment variable. That is, OVERRIDE_ENV holds
-# the path to a file of var=value pairs. Historically, this file was created by a
-# build environment such as Github Actions. However, it is actually simpler just to use
-# option 1: just set the values in the environment and let Linux pass them through to
-# this script.
-# 4. Environment variables of the form "druid_" used to create the Druid config file.
-#
-# All of the above are combined into a temporary environment file which is then passed
-# into Docker compose.
-#
-# The file is built when the cluster comes up. It is reused in the test and down
-# commands so we have a consistent environment.
-function build_override {
-
- mkdir -p "$MODULE_DIR/target"
- OVERRIDE_FILE="$MODULE_DIR/target/override.env"
- rm -f "$OVERRIDE_FILE"
- touch "$OVERRIDE_FILE"
-
- # Provided override file
- if [ -n "$OVERRIDE_ENV" ]; then
- if [ ! -f "$OVERRIDE_ENV" ]; then
- echo "Environment override file OVERRIDE_ENV not found: $OVERRIDE_ENV" 1>&2
- exit 1
- fi
- cat "$OVERRIDE_ENV" >> "$OVERRIDE_FILE"
- fi
-
- # User-local settings?
- LOCAL_ENV="$HOME/druid-it/${CATEGORY}.env"
- if [ -f "$LOCAL_ENV" ]; then
- cat "$LOCAL_ENV" >> "$OVERRIDE_FILE"
- fi
-
- # Add all environment variables of the form druid_*
- set +e # Grep gives exit status 1 if no lines match. Let's not fail.
- env | grep "^druid_" >> "$OVERRIDE_FILE"
- set -e
-
- # TODO: Add individual env vars that we want to pass from the local
- # environment into the container.
-
- # Reuse the OVERRIDE_ENV variable to pass the full list to Docker compose
- export OVERRIDE_ENV="$OVERRIDE_FILE"
-}
-
-function reuse_override {
- OVERRIDE_FILE="$MODULE_DIR/target/override.env"
- if [ ! -f "$OVERRIDE_FILE" ]; then
- echo "Override file $OVERRIDE_FILE not found: Was an 'up' run?" 1>&2
- exit 1
- fi
- export OVERRIDE_ENV="$OVERRIDE_FILE"
-}
-
-function require_category {
- if [ -z "$CATEGORY" ]; then
- usage 1>&2
- exit 1
- fi
-}
-
-function require_env_var {
- if [ -z "$1" ]; then
- echo "$1 must be set for test category $CATEGORY" 1>&2
- exit 1
- fi
-}
-
-# Verfiy any test-specific environment variables that must be set in this local
-# environment (and generally passed into the Docker container via docker-compose.yaml).
-#
-# Add entries here as you add env var references in docker-compose.yaml. Doing so
-# ensures we get useful error messages when we forget to set something, rather than
-# some cryptic use-specific error.
-function verify_env_vars {
- VERIFY_SCRIPT="$MODULE_DIR/cluster/$DRUID_INTEGRATION_TEST_GROUP/verify.sh"
- if [ -f "$VERIFY_SCRIPT" ]; then
- . "$VERIFY_SCRIPT"
- fi
-}
-
-if [ $# -eq 0 ]; then
- usage
- exit 1
-fi
-
-CMD=$1
-shift
-if [ $# -gt 0 ]; then
- CATEGORY=$1
- shift
-fi
-
-# Handle an IT in either the usual druid-it-cases project, or elsewhere,
-# typically in an extension. The Maven module, if needed must be the third
-# parameter in path, not coordinate, form.
-if [ $# -eq 0 ]; then
- # Use the usual project
- MAVEN_PROJECT=":druid-it-cases"
- # Don't provide a project path to cluster.sh
- unset IT_MODULE_DIR
- # Generate the override.sh file in the druid-it-cases module
- MODULE_DIR=$DRUID_DEV/integration-tests-ex/cases
-else
- # The test module is given via the command line argument as a relative path
- MAVEN_PROJECT="$1"
- # Compute the full path to the target module for use by cluster.sh
- export IT_MODULE_DIR="$DRUID_DEV/$1"
- # Write the override.sh file to the target module
- MODULE_DIR=$IT_MODULE_DIR
- shift
-fi
-
-IT_CASES_DIR="$DRUID_DEV/integration-tests-ex/cases"
-
-# Added -Dcyclonedx.skip=true to avoid ISO-8859-1 [ERROR]s
-# May be fixed in the future
-MAVEN_IGNORE="-P skip-static-checks,skip-tests -Dmaven.javadoc.skip=true -Dcyclonedx.skip=true"
-TEST_OPTIONS="verify -P skip-static-checks,docker-tests \
- -Dmaven.javadoc.skip=true -Dcyclonedx.skip=true -DskipUTs=true"
-
-case $CMD in
- "help" )
- usage
- ;;
- "ci" )
- mvn -q clean install -P dist,bundle-contrib-exts $MAVEN_IGNORE
- ;;
- "build" )
- mvn -B clean install -P dist,bundle-contrib-exts $MAVEN_IGNORE -T1.0C $*
- ;;
- "dist" )
- mvn -B install -P dist,bundle-contrib-exts $MAVEN_IGNORE -pl :distribution
- ;;
- "tools" )
- mvn -B install -pl :druid-it-tools
- ;;
- "image" )
- cd $DRUID_DEV/integration-tests-ex/image
- mvn -B install -P test-image $MAVEN_IGNORE
- ;;
- "gen")
- # Generate the docker-compose.yaml files. Mostly for debugging
- # since the up command does generation implicitly.
- require_category
- $IT_CASES_DIR/cluster.sh gen $CATEGORY
- ;;
- "up" )
- require_category
- build_override
- verify_env_vars
- $IT_CASES_DIR/cluster.sh up $CATEGORY
- ;;
- "down" )
- require_category
- reuse_override
- $IT_CASES_DIR/cluster.sh down $CATEGORY
- ;;
- "run" )
- require_category
- reuse_override
- mvn -B $TEST_OPTIONS -P IT-$CATEGORY -pl $MAVEN_PROJECT
- ;;
- "test" )
- require_category
- build_override
- verify_env_vars
- $IT_CASES_DIR/cluster.sh up $CATEGORY
-
- # Run the test. On failure, still shut down the cluster.
- # Return Maven's return code as the script's return code.
- set +e
- mvn -B $TEST_OPTIONS -P IT-$CATEGORY -pl $MAVEN_PROJECT
- RESULT=$?
- set -e
- $IT_CASES_DIR/cluster.sh down $CATEGORY
- exit $RESULT
- ;;
- "tail" )
- require_category
- tail_logs
- ;;
- "github" )
- set +e
- $0 test $CATEGORY
- RESULT=$?
-
- # Include logs, but only for failures.
- if [ $RESULT -ne 0 ]; then
- $0 tail $CATEGORY
- fi
- exit $RESULT
- ;;
- # Name is deliberately long to avoid accidental use.
- "prune-containers" )
- if [ $(docker ps | wc -l) -ne 1 ]; then
- echo "Cleaning running containers"
- docker ps
- docker ps -aq | xargs -r docker rm -f
- fi
- ;;
- "prune-volumes" )
- # Caution: this removes all volumes, which is generally what you
- # want when testing.
- docker system prune -af --volumes
- ;;
- * )
- usage
- exit 1
- ;;
-esac
diff --git a/pom.xml b/pom.xml
index b27d98f180f..c5469af4b4a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -268,7 +268,6 @@
<!-- distribution packaging -->
<module>distribution</module>
<!-- more test stuff -->
- <module>integration-tests-ex/tools</module>
<module>quidem-ut</module>
<module>embedded-tests</module>
</modules>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org