-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add DruidContainers to run docker tests with embedded-test framework #18302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a7698e3
bfd4f6a
3508e64
099c47b
a926d9c
16b649e
7965826
2006e4f
d35c36b
e9eec86
2678c69
ac3df1e
2ec86f4
a0b7b63
3654904
14e3c6b
a9c1b23
28c8dab
bf77c43
8ae997a
e81c1f8
35c8d40
aba2e27
7178779
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 }}]" | ||
|
|
@@ -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 }}]" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # 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-tests: | ||
| name: Run Docker tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - 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: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: 17 | ||
| cache: 'maven' | ||
| - name: Run *DockerTest* | ||
| id: run-it | ||
| run: | | ||
| source .github/scripts/distribution_checks_env.sh | ||
| .github/scripts/run_unit-tests -Dtest=*DockerTest* -Ddruid.testing.docker.image=$DRUID_DIST_IMAGE_NAME | ||
|
||
| timeout-minutes: 60 | ||
|
|
||
| - name: Collect docker logs on failure | ||
| if: ${{ failure() && steps.run-it.conclusion == 'failure' }} | ||
| run: | | ||
| mkdir docker-logs | ||
| for c in $(docker ps -a --format="{{.Names}}") | ||
| do | ||
| docker logs $c > ./docker-logs/$c.log | ||
| done | ||
|
Comment on lines
+54
to
+61
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you integrate this into the |
||
| - name: Tar docker logs | ||
| if: ${{ failure() && steps.run-it.conclusion == 'failure' }} | ||
| run: tar cvzf ./docker-logs.tgz ./docker-logs | ||
|
|
||
| - name: Upload docker logs to GitHub | ||
| if: ${{ failure() && steps.run-it.conclusion == 'failure' }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: failure-docker-logs | ||
| path: docker-logs.tgz | ||
|
|
||
| - name: Collect service logs on failure | ||
| if: ${{ failure() && steps.run-it.conclusion == 'failure' }} | ||
| run: | | ||
| tar cvzf ./service-logs.tgz /tmp/embedded-tests | ||
kgyrtkirk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Upload Druid service logs to GitHub | ||
| if: ${{ failure() && steps.run-it.conclusion == 'failure' }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: failure-service-logs | ||
| path: service-logs.tgz | ||
|
|
||
| - name: Collect surefire reports on failure | ||
| if: ${{ failure() && steps.run-it.conclusion == 'failure' }} | ||
| run: | | ||
| tar cvzf ./surefire-logs.tgz ./embedded-tests/target/surefire-reports | ||
| - name: Upload surefire reports to GitHub | ||
| if: ${{ failure() && steps.run-it.conclusion == 'failure' }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: failure-surefire-logs | ||
| path: surefire-logs.tgz | ||
Uh oh!
There was an error while loading. Please reload this page.