Skip to content
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

It test #16806

Closed
wants to merge 29 commits into from
Closed

It test #16806

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ca33d8b
Fix build
findingrish Mar 14, 2024
1abba25
Merge branch 'master' of github.com:findingrish/druid
findingrish Jun 10, 2024
4982882
Merge remote-tracking branch 'upstream/master'
findingrish Jun 20, 2024
1940170
Merge remote-tracking branch 'upstream/master'
findingrish Jul 17, 2024
4c1711e
Merge remote-tracking branch 'upstream/master'
findingrish Jul 21, 2024
61f9b4b
Add IT to test BackwardIncompatibility
findingrish Jul 21, 2024
a58e7ed
minor change
findingrish Jul 21, 2024
c41cdeb
test
findingrish Jul 21, 2024
b08cf00
test
findingrish Jul 21, 2024
00b8f29
disable some gha checks temporarily
findingrish Jul 21, 2024
a351a48
Set env while running revised it
findingrish Jul 21, 2024
ccad637
another way to set env
findingrish Jul 21, 2024
bfad1e4
log envs in it.sh
findingrish Jul 21, 2024
b290f87
test
findingrish Jul 21, 2024
666609e
fix minor bug
findingrish Jul 21, 2024
a5e4863
pass env vars in resusable-revised-its
findingrish Jul 21, 2024
0616c79
enable maven build again
findingrish Jul 21, 2024
97486b5
remove env override from pom
findingrish Jul 22, 2024
4df3296
temporarily remove conditional
findingrish Jul 22, 2024
4d97b55
use correct jdk version in docker tag step
findingrish Jul 22, 2024
f977f24
cache the previous image as well
findingrish Jul 22, 2024
3a5c798
minor change
findingrish Jul 22, 2024
8811712
fix env var usage
findingrish Jul 22, 2024
f8aa164
Remove test changes to set env var in it.sh
findingrish Jul 22, 2024
b067b30
Debug failure in untarring the previous version
findingrish Jul 22, 2024
721532c
Cleanup test changes
findingrish Jul 22, 2024
3604451
Derive BACKWARD_INCOMPATIBILITY_IT_ENABLED and DRUID_PREVIOUS_IT_IMAG…
findingrish Jul 26, 2024
3ac2385
Rename test group to BackwardCompatibility
findingrish Jul 26, 2024
7c34af3
rename config var in gha
findingrish Jul 26, 2024
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
49 changes: 48 additions & 1 deletion .github/workflows/reusable-revised-its.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ on:
AWS_SECRET_ACCESS_KEY:
required: false
type: string
BACKWARD_COMPATIBILITY_IT_ENABLED:
required: false
type: string
default: false
DRUID_PREVIOUS_VERSION:
required: false
type: string
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL:
required: false
type: string
DRUID_PREVIOUS_IT_IMAGE_NAME:
required: false
type: string

env:
MYSQL_DRIVER_CLASSNAME: ${{ inputs.mysql_driver }} # Used by tests to connect to metadata store directly.
Expand Down Expand Up @@ -106,6 +119,15 @@ jobs:
./druid-container-jdk${{ inputs.build_jdk }}.tar.gz
./integration-tests-ex/image/target/env.sh

- name: Retrieve previous version cached docker image
id: docker-restore-previous-version
if: ${{ inputs.BACKWARD_COMPATIBILITY_IT_ENABLED == 'true' }}
uses: actions/cache/restore@v4
with:
key: druid-container-jdk${{ inputs.build_jdk }}-version${{ inputs.DRUID_PREVIOUS_VERSION }}.tar.gz-${{ github.sha }}
path: |
./druid-container-jdk${{ inputs.build_jdk }}-version${{ inputs.DRUID_PREVIOUS_VERSION }}.tar.gz

- name: Maven build
if: steps.maven-restore.outputs.cache-hit != 'true' || ( steps.docker-restore.outputs.cache-hit != 'true' && steps.targets-restore.outputs.cache-hit != 'true' )
run: |
Expand All @@ -115,13 +137,26 @@ jobs:
if: steps.docker-restore.outputs.cache-hit != 'true' || steps.maven-restore.outputs.cache-hit != 'true'
env:
docker-restore: ${{ toJson(steps.docker-restore.outputs) }}
BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ inputs.BACKWARD_COMPATIBILITY_IT_ENABLED }}
DRUID_PREVIOUS_VERSION: ${{ inputs.DRUID_PREVIOUS_VERSION }}
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ inputs.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ inputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}
run: |
./it.sh image
source ./integration-tests-ex/image/target/env.sh
docker tag $DRUID_IT_IMAGE_NAME $DRUID_IT_IMAGE_NAME-jdk${{ inputs.build_jdk }}
echo $DRUID_IT_IMAGE_NAME
docker save "$DRUID_IT_IMAGE_NAME" | gzip > druid-container-jdk${{ inputs.build_jdk }}.tar.gz

- name: Save previous version docker image
if: ${{ inputs.BACKWARD_COMPATIBILITY_IT_ENABLED == 'true' && (steps.docker-restore.outputs.cache-hit != 'true' || steps.maven-restore.outputs.cache-hit != 'true') }}
env:
docker-restore: ${{ toJson(steps.docker-restore.outputs) }}
run: |
docker tag ${{ inputs.DRUID_PREVIOUS_IT_IMAGE_NAME }} ${{ inputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}-jdk${{ inputs.build_jdk }}-version${{ inputs.DRUID_PREVIOUS_VERSION }}
echo ${DRUID_PREVIOUS_IT_IMAGE_NAME}
docker save "${{ inputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}" | gzip > druid-container-jdk${{ inputs.build_jdk }}-version${{ inputs.DRUID_PREVIOUS_VERSION }}.tar.gz

- name: Stop and remove docker containers
run: |
echo "Force stopping all containers and pruning"
Expand All @@ -133,9 +168,21 @@ jobs:
docker load --input druid-container-jdk${{ inputs.build_jdk }}.tar.gz
docker images

- name: Load previous version docker image
if: ${{ inputs.BACKWARD_COMPATIBILITY_IT_ENABLED == 'true' }}
run: |
docker load --input druid-container-jdk${{ inputs.build_jdk }}-version${{ inputs.DRUID_PREVIOUS_VERSION }}.tar.gz
docker images

- name: Run IT
id: run-it
run: ${{ inputs.script }}
env:
BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ inputs.BACKWARD_COMPATIBILITY_IT_ENABLED }}
DRUID_PREVIOUS_VERSION: ${{ inputs.DRUID_PREVIOUS_VERSION }}
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ inputs.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ inputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}
run: |
${{ inputs.script }}

- name: Collect docker logs on failure
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/revised-its.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
name: "Revised ITs workflow"
on:
workflow_call:
inputs:
BACKWARD_COMPATIBILITY_IT_ENABLED:
description: "Flag for backward compatibility IT"
required: false
default: false
type: string
DRUID_PREVIOUS_VERSION:
description: "Previous druid versions to run the test against."
required: false
type: string
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL:
description: "URL to download the previous druid version."
required: false
type: string
DRUID_PREVIOUS_IT_IMAGE_NAME:
description: "Druid previous version image name."
required: false
type: string
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -79,3 +97,19 @@ jobs:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: admin
AWS_SECRET_ACCESS_KEY: miniopassword

backward-compatibility-it:
needs: changes
uses: ./.github/workflows/reusable-revised-its.yml
if: ${{ inputs.BACKWARD_COMPATIBILITY_IT_ENABLED == 'true' && (needs.changes.outputs.core == 'true' || needs.changes.outputs.common-extensions == 'true') }}
with:
build_jdk: 8
runtime_jdk: 8
use_indexer: MiddleManager
script: ./it.sh github BackwardIncompatibility
it: BackwardIncompatibility
mysql_driver: com.mysql.jdbc.Driver
BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ inputs.BACKWARD_COMPATIBILITY_IT_ENABLED }}
DRUID_PREVIOUS_VERSION: ${{ inputs.DRUID_PREVIOUS_VERSION }}
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ inputs.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ inputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}
56 changes: 55 additions & 1 deletion .github/workflows/unit-and-integration-tests-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,28 @@ concurrency:
env:
MYSQL_DRIVER_CLASSNAME: com.mysql.jdbc.Driver # Used to set druid config in docker image for revised ITs
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
DRUID_PREVIOUS_VERSION: 30.0.0
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: https://dlcdn.apache.org/druid/30.0.0/apache-druid-30.0.0-bin.tar.gz
#BACKWARD_COMPATIBILITY_IT_ENABLED: true
#DRUID_PREVIOUS_IT_IMAGE_NAME: org.apache.druid.integration-tests/test:30.0.0

jobs:
set-new-env-var:
name: Set new env var
runs-on: ubuntu-latest
steps:
- name: Set new environment variable
run: |
if [ -n "${{ env.DRUID_PREVIOUS_VERSION }}" ]; then
echo "export BACKWARD_COMPATIBILITY_IT_ENABLED=true" >> $GITHUB_ENV
else
echo "export BACKWARD_COMPATIBILITY_IT_ENABLED=false" >> $GITHUB_ENV
fi
echo "export DRUID_PREVIOUS_IT_IMAGE_NAME=org.apache.druid.integration-tests/test:${{ env.DRUID_PREVIOUS_VERSION }}" >> $GITHUB_ENV
echo "New environment variable: $DRUID_PREVIOUS_IT_IMAGE_NAME, $BACKWARD_COMPATIBILITY_IT_ENABLED"

build:
needs: set-new-env-var
name: "build (jdk${{ matrix.jdk }})"
strategy:
fail-fast: false
Expand Down Expand Up @@ -94,12 +113,25 @@ jobs:
./druid-container-jdk${{ matrix.jdk }}.tar.gz
./integration-tests-ex/image/target/env.sh

- name: Cache previous version image
id: docker_container_previous_version
uses: actions/cache@v4
with:
key: druid-container-jdk${{ matrix.jdk }}-version${{ env.DRUID_PREVIOUS_VERSION }}.tar.gz-${{ github.sha }}
path: |
./druid-container-jdk${{ matrix.jdk }}-version${{ env.DRUID_PREVIOUS_VERSION }}.tar.gz

- name: Maven build
id: maven_build
run: |
./it.sh ci

- name: Container build
env:
BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ env.BACKWARD_COMPATIBILITY_IT_ENABLED }}
DRUID_PREVIOUS_VERSION: ${{ env.DRUID_PREVIOUS_VERSION }}
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ env.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ env.DRUID_PREVIOUS_IT_IMAGE_NAME }}
run: |
./it.sh image
source ./integration-tests-ex/image/target/env.sh
Expand All @@ -111,6 +143,13 @@ jobs:
echo $DRUID_IT_IMAGE_NAME
docker save "$DRUID_IT_IMAGE_NAME" | gzip > druid-container-jdk${{ matrix.jdk }}.tar.gz

- name: Save previous version docker image
if: ${{ env.BACKWARD_COMPATIBILITY_IT_ENABLED == 'true' }}
run: |
docker tag ${{ env.DRUID_PREVIOUS_IT_IMAGE_NAME }} ${{ env.DRUID_PREVIOUS_IT_IMAGE_NAME }}-jdk${{ matrix.jdk }}-version${{ env.DRUID_PREVIOUS_VERSION }}
echo ${{ env.DRUID_PREVIOUS_IT_IMAGE_NAME }}
docker save "${{ env.DRUID_PREVIOUS_IT_IMAGE_NAME }}" | gzip > druid-container-jdk${{ matrix.jdk }}-version${{ env.DRUID_PREVIOUS_VERSION }}.tar.gz

unit-tests-phase2:
strategy:
fail-fast: false
Expand Down Expand Up @@ -141,7 +180,22 @@ jobs:
if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
uses: ./.github/workflows/standard-its.yml

expose-vars:
runs-on: ubuntu-latest
outputs:
DRUID_PREVIOUS_VERSION: ${{ env.DRUID_PREVIOUS_VERSION }}
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ env.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ BACKWARD_COMPATIBILITY_IT_ENABLED }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ DRUID_PREVIOUS_IT_IMAGE_NAME }}
steps:
- run: echo "Exposing env vars"

revised-its:
needs: unit-tests
needs: [unit-tests, expose-vars]
if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
uses: ./.github/workflows/revised-its.yml
with:
BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ needs.expose-vars.outputs.BACKWARD_COMPATIBILITY_IT_ENABLED }}
DRUID_PREVIOUS_VERSION: ${{ needs.expose-vars.outputs.DRUID_PREVIOUS_VERSION }}
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ needs.expose-vars.outputs.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ needs.expose-vars.outputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# 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.

networks:
druid-it-net:
name: druid-it-net
ipam:
config:
- subnet: 172.172.172.0/24

services:
zookeeper:
extends:
file: ../Common/dependencies.yaml
service: zookeeper

metadata:
extends:
file: ../Common/dependencies.yaml
service: metadata

coordinator:
extends:
file: ../Common/druid.yaml
service: coordinator
image: ${DRUID_PREVIOUS_IT_IMAGE_NAME}
container_name: coordinator
environment:
- DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
# The frequency with which the coordinator polls the database
# for changes. The DB population code has to wait at least this
# long for the coordinator to notice changes.
- druid_manager_segments_pollDuration=PT5S
- druid_coordinator_period=PT10S
depends_on:
- zookeeper
- metadata

overlord:
extends:
file: ../Common/druid.yaml
service: overlord
image: ${DRUID_PREVIOUS_IT_IMAGE_NAME}
container_name: overlord
environment:
- DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
depends_on:
- zookeeper
- metadata

broker:
extends:
file: ../Common/druid.yaml
service: broker
environment:
- DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
depends_on:
- zookeeper

router:
extends:
file: ../Common/druid.yaml
service: router
environment:
- DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
depends_on:
- zookeeper

historical:
extends:
file: ../Common/druid.yaml
service: historical
environment:
- DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
depends_on:
- zookeeper

middlemanager:
extends:
file: ../Common/druid.yaml
service: middlemanager
environment:
- DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
volumes:
# Test data
- ../../resources:/resources
depends_on:
- zookeeper

kafka:
extends:
file: ../Common/dependencies.yaml
service: kafka
depends_on:
- zookeeper
9 changes: 9 additions & 0 deletions integration-tests-ex/cases/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,15 @@
<it.category>GcsDeepStorage</it.category>
</properties>
</profile>
<profile>
<id>IT-BackwardCompatibility</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<it.category>BackwardCompatibility</it.category>
</properties>
</profile>
<profile>
<id>docker-tests</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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.testsEx.BackwardCompatibility;

import org.apache.druid.testsEx.categories.BackwardCompatibility;
import org.apache.druid.testsEx.config.DruidTestRunner;
import org.apache.druid.testsEx.indexer.IndexerTest;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

@RunWith(DruidTestRunner.class)
@Category({BackwardCompatibility.class})
public class ITBackwardCompatibilityIndexerTest extends IndexerTest
{
}
Loading
Loading