Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/scripts/distribution_checks_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# 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.
#

export DRUID_DIST_IMAGE_NAME=apache/druid:35.0.0-SNAPSHOT
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
pattern: [ "C*", "H*,U*,V*", "N*,Q*,S*", "B*,O*,R*", "G*,J*,K*", "F*,L*,M*", "A*,D*,I*,X*,Y*,Z*", "E*,P*,T*,W*"]
uses: ./.github/workflows/worker.yml
with:
script: .github/scripts/run_unit-tests -Dtest=!QTest,'${{ matrix.pattern }}' -Dmaven.test.failure.ignore=true
script: .github/scripts/run_unit-tests -Dtest=!QTest,!*DockerTest,'${{ matrix.pattern }}' -Dmaven.test.failure.ignore=true
jdk: 17
artifact_prefix: "unit-test-reports"
key: "test-jdk17-[${{ matrix.pattern }}]"
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
pattern: [ "C*", "H*,U*,V*", "N*,Q*,S*", "B*,O*,R*", "G*,J*,K*", "F*,L*,M*", "A*,D*,I*,X*,Y*,Z*", "E*,P*,T*,W*"]
uses: ./.github/workflows/worker.yml
with:
script: .github/scripts/run_unit-tests -Dtest=!QTest,'${{ matrix.pattern }}' -fae
script: .github/scripts/run_unit-tests -Dtest=!QTest,!*DockerTest,'${{ matrix.pattern }}' -fae
jdk: ${{ matrix.jdk }}
key: "test-jdk${{ matrix.jdk }}-[${{ matrix.pattern }}]"

Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/distribution-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: DOCKER_BUILDKIT=1 docker build -t apache/druid:tag -f distribution/docker/Dockerfile .
run: |
source .github/scripts/distribution_checks_env.sh
DOCKER_BUILDKIT=1 docker build -t $DRUID_DIST_IMAGE_NAME -f distribution/docker/Dockerfile .
- name: Save Docker image to archive
run: |
source .github/scripts/distribution_checks_env.sh
echo "Saving image $DRUID_DIST_IMAGE_NAME in archive druid-dist-container.tar.gz"
docker save "$DRUID_DIST_IMAGE_NAME" | gzip > druid-dist-container.tar.gz
- name: Cache Docker image
id: docker_dist_container
uses: actions/cache@v4
with:
key: druid-dist-container.tar.gz-${{ github.sha }}
path: |
./druid-dist-container.tar.gz
50 changes: 50 additions & 0 deletions .github/workflows/docker-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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.

name: "Docker Tests using Distribution Image"
on:
workflow_call:

jobs:
run-docker-test:
name: Run Docker Tests
runs-on: ubuntu-latest
steps:
- name: Retrieve Docker container
id: docker-restore
uses: actions/cache/restore@v4
with:
key: druid-dist-container.tar.gz-${{ github.sha }}
path: |
./druid-dist-container.tar.gz
- name: Stop and remove Druid Docker containers
run: |
echo "Force stopping all Druid containers and pruning"
docker ps -aq --filter "ancestor=apache/druid" | xargs -r docker rm -f
docker system prune -af --volumes
- name: Load Docker image
run: |
docker load --input druid-dist-container.tar.gz
docker images
- name: Get Docker image name env
run: |
source .github/workflows/distribution_checks_env.sh
echo "DRUID_DIST_IMAGE_NAME=$DRUID_DIST_IMAGE_NAME" >> $GITHUB_ENV
- name: Run the test
uses: ./.github/workflows/worker.yml
with:
script: .github/scripts/run_unit-tests -Dtest=*DockerTest -Ddruid.testing.docker.image=$DRUID_DIST_IMAGE_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is DockerTest defined? is this some kind of smoke test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an IngestionDockerTest that is being newly added in this PR. This command will run future tests also which have the same suffix. But yes, for the most part, it is meant to be a smoke test.

jdk: 17
key: "test-jdk17-docker"
4 changes: 4 additions & 0 deletions .github/workflows/unit-and-integration-tests-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ jobs:
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ needs.set-env-var.outputs.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ needs.set-env-var.outputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}

docker-tests:
needs: [build, unit-tests]
uses: ./github/workflows/docker-tests.yml

actions-timeline:
needs: [build, unit-tests, revised-its, standard-its]
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions embedded-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
<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>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down
Loading
Loading