2023-02-01 06:31:29 -05:00
|
|
|
# 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.
|
|
|
|
|
2023-05-22 02:14:34 -04:00
|
|
|
name: "Standard ITs shared workflow"
|
2023-02-01 06:31:29 -05:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
runtime_jdk:
|
|
|
|
description: 'Which JDK version to use at runtime'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
use_indexer:
|
|
|
|
description: 'Which indexer to use'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
override_config_path:
|
|
|
|
description: 'Existing Druid configuration (using Docker) can be overridden or new config vars can be set e.g. when using cloud storage'
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
group:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
description: 'Name of group of tests running (to display)'
|
|
|
|
testing_groups:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
build_jdk:
|
|
|
|
description: 'Which jdk version was used to build'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
mysql_driver:
|
|
|
|
description: 'MySQL driver to use'
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: com.mysql.jdbc.Driver
|
|
|
|
|
|
|
|
env:
|
|
|
|
MVN: mvn --no-snapshot-updates
|
|
|
|
MAVEN_SKIP: -P skip-static-checks -Dweb.console.skip=true -Dmaven.javadoc.skip=true
|
|
|
|
MAVEN_SKIP_TESTS: -P skip-tests
|
|
|
|
DOCKER_IP: 127.0.0.1 # for integration tests
|
|
|
|
MYSQL_DRIVER_CLASSNAME: ${{ inputs.mysql_driver }}
|
|
|
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test: # Github job that runs a given standard/old IT for a given testing group
|
|
|
|
name: ${{ inputs.group }} integration test (Compile=jdk${{ inputs.build_jdk }}, Run=jdk${{ inputs.runtime_jdk }}, Indexer=${{ inputs.use_indexer }}, Mysql=${{ inputs.mysql_driver }})
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
2024-03-07 21:24:02 -05:00
|
|
|
uses: actions/checkout@v4
|
2023-02-01 06:31:29 -05:00
|
|
|
|
2023-10-19 23:18:13 -04:00
|
|
|
- name: setup java
|
2024-03-07 21:24:02 -05:00
|
|
|
uses: actions/setup-java@v4
|
2023-10-19 23:18:13 -04:00
|
|
|
with:
|
|
|
|
java-version: ${{ inputs.runtime_jdk }}
|
|
|
|
distribution: 'zulu'
|
2023-02-01 06:31:29 -05:00
|
|
|
|
|
|
|
- name: Restore Maven repository
|
|
|
|
id: maven-restore
|
2024-03-07 21:24:02 -05:00
|
|
|
uses: actions/cache/restore@v4
|
2023-02-01 06:31:29 -05:00
|
|
|
with:
|
2023-02-03 18:49:17 -05:00
|
|
|
path: ~/.m2/repository
|
|
|
|
key: maven-${{ runner.os }}-${{ inputs.build_jdk }}-${{ github.sha }}
|
2023-02-10 11:57:45 -05:00
|
|
|
|
|
|
|
- name: Maven build
|
|
|
|
if: steps.maven-restore.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
./it.sh ci
|
2023-02-01 06:31:29 -05:00
|
|
|
|
|
|
|
- name: Run IT
|
2023-03-29 12:06:41 -04:00
|
|
|
id: run-it
|
2023-02-01 06:31:29 -05:00
|
|
|
env:
|
|
|
|
MYSQL_DRIVER_CLASSNAME: ${{ inputs.mysql_driver }}
|
|
|
|
run: |
|
|
|
|
# Debug echo
|
|
|
|
echo "Mysql driver: ${MYSQL_DRIVER_CLASSNAME}"
|
2023-02-20 05:45:15 -05:00
|
|
|
echo "${MVN} verify -pl integration-tests -P integration-tests ${{ inputs.testing_groups }} -Djvm.runtime=${{ inputs.runtime_jdk }} -Dit.indexer=${{ inputs.use_indexer }} ${MAVEN_SKIP} -Doverride.config.path=${{ inputs.override_config_path }}"
|
|
|
|
${MVN} verify -pl integration-tests -P integration-tests ${{ inputs.testing_groups }} -Djvm.runtime=${{ inputs.runtime_jdk }} -Dit.indexer=${{ inputs.use_indexer }} ${MAVEN_SKIP} -Doverride.config.path=${{ inputs.override_config_path }}
|
2023-03-29 12:06:41 -04:00
|
|
|
|
2023-09-13 02:02:04 -04:00
|
|
|
- name: Collect docker logs on failure
|
2023-05-22 02:14:34 -04:00
|
|
|
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
|
2023-03-29 12:06:41 -04:00
|
|
|
run: |
|
2023-09-28 05:55:52 -04:00
|
|
|
mkdir docker-logs
|
2023-09-13 02:02:04 -04:00
|
|
|
for c in $(docker ps -a --format="{{.Names}}")
|
|
|
|
do
|
|
|
|
docker logs $c > ./docker-logs/$c.log
|
2023-03-29 12:06:41 -04:00
|
|
|
done
|
2023-09-13 02:02:04 -04:00
|
|
|
|
|
|
|
- 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@master
|
|
|
|
with:
|
|
|
|
name: IT-${{ inputs.group }} docker logs (Compile=jdk${{ inputs.build_jdk }}, Run=jdk${{ inputs.runtime_jdk }}, Indexer=${{ inputs.use_indexer }}, Mysql=${{ inputs.mysql_driver }})
|
|
|
|
path: docker-logs.tgz
|
|
|
|
|
|
|
|
- name: Collect service logs on failure
|
|
|
|
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
|
|
|
|
run: |
|
2024-06-22 02:15:54 -04:00
|
|
|
tar cvzf ./service-logs.tgz ~/shared/logs ~/shared/tasklogs
|
2023-09-13 02:02:04 -04:00
|
|
|
|
|
|
|
- name: Upload Druid service logs to GitHub
|
|
|
|
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
|
|
|
|
uses: actions/upload-artifact@master
|
|
|
|
with:
|
|
|
|
name: IT-${{ inputs.group }} service logs (Compile=jdk${{ inputs.build_jdk }}, Run=jdk${{ inputs.runtime_jdk }}, Indexer=${{ inputs.use_indexer }}, Mysql=${{ inputs.mysql_driver }})
|
|
|
|
path: service-logs.tgz
|