World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#12091] improvement(ci): Route contrib catalog tests to contrib CI (#12092)
roryqie675c0465c2b
diff --git a/.github/workflows/backend-integration-test-action.yml b/.github/workflows/backend-integration-test-action.ymlindex 08b82f9331..56a7a7c6a0 100644--- a/.github/workflows/backend-integration-test-action.yml+++ b/.github/workflows/backend-integration-test-action.yml@@ -20,11 +20,6 @@ on:required: truedescription: 'run on embedded or deploy mode'type: string- changed-catalogs-contrib-modules:- required: false- description: 'space-separated changed catalogs-contrib module names, or __all__'- type: string- default: ''jobs:start-runner:@@ -66,17 +61,10 @@ jobs:- name: Backend Integration Test (JDK${{ inputs.java-version }}-${{ inputs.test-mode }}-${{ inputs.backend }})id: integrationTestrun: |- ALL_CONTRIB_MODULES="$(find catalogs-contrib -mindepth 1 -maxdepth 1 -type d -name 'catalog-*' -exec basename {} \; | sort)"- CHANGED_CONTRIB_MODULES="${{ inputs.changed-catalogs-contrib-modules }}"-EXCLUDE_CONTRIB_TESTS=""- if [ "$CHANGED_CONTRIB_MODULES" != "__all__" ]; then- for module in $ALL_CONTRIB_MODULES; do- if [[ " $CHANGED_CONTRIB_MODULES " != *" $module "* ]]; then- EXCLUDE_CONTRIB_TESTS="$EXCLUDE_CONTRIB_TESTS -x :catalogs-contrib:$module:test"- fi- done- fi+ for module in $(find catalogs-contrib -mindepth 1 -maxdepth 1 -type d -name 'catalog-*' -exec basename {} \; | sort); do+ EXCLUDE_CONTRIB_TESTS="$EXCLUDE_CONTRIB_TESTS -x :catalogs-contrib:$module:test"+ done./gradlew test -PskipTests -PtestMode=${{ inputs.test-mode }} -PjdbcBackend=${{ inputs.backend }} -PskipDockerTests=false -PskipWeb=true \-x :web:web:test -x :web:integration-test:test -x :web-v2:web:test -x :web-v2:integration-test:test -x :clients:client-python:test \@@ -106,7 +94,5 @@ jobs:distribution/package/logs/*.logcatalogs/**/*.logcatalogs/**/*.tar- catalogs-contrib/**/*.log- catalogs-contrib/**/*.tardistribution/**/*.logdistribution/**/*.outdiff --git a/.github/workflows/backend-integration-test.yml b/.github/workflows/backend-integration-test.ymlindex 2857db4733..6319266a68 100644--- a/.github/workflows/backend-integration-test.yml+++ b/.github/workflows/backend-integration-test.yml@@ -27,7 +27,6 @@ jobs:- api/**- bin/**- catalogs/**- - catalogs-contrib/**- clients/client-java/**- clients/client-java-runtime/**- clients/filesystem-hadoop3/**@@ -49,38 +48,8 @@ jobs:- gradle.properties- gradlew- settings.gradle.kts- - name: Detect changed catalogs-contrib modules- id: contrib- run: |- if [ "${{ github.event_name }}" = "pull_request" ]; then- BASE_SHA="${{ github.event.pull_request.base.sha }}"- HEAD_SHA="${{ github.event.pull_request.head.sha }}"- else- BASE_SHA="${{ github.event.before }}"- HEAD_SHA="${{ github.sha }}"- fi-- if [ -z "$BASE_SHA" ] || [ "$BASE_SHA" = "0000000000000000000000000000000000000000" ]; then- BASE_SHA="$(git rev-list --max-parents=0 "$HEAD_SHA" | tail -n 1)"- fi-- MERGE_BASE_SHA="$(git merge-base "$BASE_SHA" "$HEAD_SHA" || true)"- if [ -z "$MERGE_BASE_SHA" ]; then- MERGE_BASE_SHA="$BASE_SHA"- fi-- CHANGED_FILES="$(git diff --name-only "$MERGE_BASE_SHA" "$HEAD_SHA")"- CHANGED_MODULES="$(echo "$CHANGED_FILES" | awk -F/ '/^catalogs-contrib\/[^/]+\// {print $2}' | sort -u | xargs)"-- # If shared catalogs-contrib build logic changes, run all contrib catalog tests.- if echo "$CHANGED_FILES" | grep -q '^catalogs-contrib/build.gradle.kts$'; then- CHANGED_MODULES="__all__"- fi-- echo "changed_catalogs_contrib_modules=$CHANGED_MODULES" >> "$GITHUB_OUTPUT"outputs:source_changes: ${{ steps.filter.outputs.source_changes }}- changed_catalogs_contrib_modules: ${{ steps.contrib.outputs.changed_catalogs_contrib_modules }}BackendIT-on-push:needs: changes@@ -104,7 +73,6 @@ jobs:java-version: ${{ matrix.java-version }}backend: ${{ matrix.backend }}test-mode: ${{ matrix.test-mode }}- changed-catalogs-contrib-modules: ${{ needs.changes.outputs.changed_catalogs_contrib_modules }}BackendIT-on-pr:needs: changes@@ -128,4 +96,3 @@ jobs:java-version: ${{ matrix.java-version }}backend: ${{ matrix.backend }}test-mode: ${{ matrix.test-mode }}- changed-catalogs-contrib-modules: ${{ needs.changes.outputs.changed_catalogs_contrib_modules }}diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 3865577d29..b41a7960ef 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -194,6 +194,9 @@ jobs:-PskipITs-PskipDockerTests=false-x :clients:client-python:build+ -x :catalogs-contrib:catalog-jdbc-clickhouse:test+ -x :catalogs-contrib:catalog-jdbc-hologres:test+ -x :catalogs-contrib:catalog-jdbc-oceanbase:test)if [ "${{ needs.changes.outputs.mcp_server_changes }}" != "true" ]; thendiff --git a/.github/workflows/contrib-catalog-test.yml b/.github/workflows/contrib-catalog-test.ymlnew file mode 100644index 0000000000..1ab459bcfe--- /dev/null+++ b/.github/workflows/contrib-catalog-test.yml@@ -0,0 +1,132 @@+name: Contrib Catalog Test++on:+ push:+ branches: [ "main", "branch-*" ]+ pull_request:+ branches: [ "main", "branch-*" ]+ workflow_dispatch:++concurrency:+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}+ cancel-in-progress: true++jobs:+ changes:+ runs-on: ubuntu-22.04+ steps:+ - uses: actions/checkout@v4+ with:+ fetch-depth: 0+ - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d+ id: filter+ with:+ filters: |+ source_changes:+ - .github/workflows/contrib-catalog-test.yml+ - catalogs-contrib/**+ - catalogs/catalog-common/**+ - catalogs/catalog-jdbc-common/**+ - dev/**+ - gradle/**+ - integration-test-common/**+ - build.gradle.kts+ - gradle.properties+ - gradlew+ - settings.gradle.kts+ - name: Detect changed catalogs-contrib modules+ id: contrib+ run: |+ if [ "${{ github.event_name }}" = "pull_request" ]; then+ BASE_SHA="${{ github.event.pull_request.base.sha }}"+ HEAD_SHA="${{ github.event.pull_request.head.sha }}"+ else+ BASE_SHA="${{ github.event.before }}"+ HEAD_SHA="${{ github.sha }}"+ fi++ if [ -z "$BASE_SHA" ] || [ "$BASE_SHA" = "0000000000000000000000000000000000000000" ]; then+ BASE_SHA="$(git rev-list --max-parents=0 "$HEAD_SHA" | tail -n 1)"+ fi++ MERGE_BASE_SHA="$(git merge-base "$BASE_SHA" "$HEAD_SHA" || true)"+ if [ -z "$MERGE_BASE_SHA" ]; then+ MERGE_BASE_SHA="$BASE_SHA"+ fi++ CHANGED_FILES="$(git diff --name-only "$MERGE_BASE_SHA" "$HEAD_SHA")"+ CHANGED_MODULES="$(echo "$CHANGED_FILES" | awk -F/ '/^catalogs-contrib\/[^/]+\// {print $2}' | sort -u | xargs)"++ if echo "$CHANGED_FILES" | grep -Eq '^(\.github/workflows/contrib-catalog-test.yml|catalogs-contrib/build.gradle.kts|catalogs/catalog-common/|catalogs/catalog-jdbc-common/|dev/|gradle/|integration-test-common/|build.gradle.kts|gradle.properties|gradlew|settings.gradle.kts)'; then+ CHANGED_MODULES="__all__"+ fi++ echo "changed_catalogs_contrib_modules=$CHANGED_MODULES" >> "$GITHUB_OUTPUT"+ outputs:+ source_changes: ${{ steps.filter.outputs.source_changes }}+ changed_catalogs_contrib_modules: ${{ steps.contrib.outputs.changed_catalogs_contrib_modules }}++ contrib-catalog-test:+ needs: changes+ if: needs.changes.outputs.source_changes == 'true' && needs.changes.outputs.changed_catalogs_contrib_modules != ''+ runs-on: ubuntu-22.04+ timeout-minutes: 90+ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-java@v4+ with:+ java-version: 17+ distribution: 'temurin'+ cache: 'gradle'++ - name: Set up QEMU+ uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0++ - name: Check required command+ run: |+ dev/ci/check_commands.sh++ - name: Free up disk space+ run: |+ dev/ci/util_free_space.sh++ - name: Install dependencies+ run: |+ wget https://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb+ sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb++ - name: Run contrib catalog tests+ id: contribCatalogTest+ run: |+ CHANGED_CONTRIB_MODULES="${{ needs.changes.outputs.changed_catalogs_contrib_modules }}"++ if [ "$CHANGED_CONTRIB_MODULES" = "__all__" ]; then+ CONTRIB_MODULES="$(find catalogs-contrib -mindepth 1 -maxdepth 1 -type d -name 'catalog-*' -exec basename {} \; | sort)"+ else+ CONTRIB_MODULES="$CHANGED_CONTRIB_MODULES"+ fi++ gradle_args=()+ for module in $CONTRIB_MODULES; do+ if [ -d "catalogs-contrib/$module" ]; then+ gradle_args+=(":catalogs-contrib:$module:test")+ fi+ done++ if [ "${#gradle_args[@]}" -eq 0 ]; then+ echo "No changed contrib catalog test tasks."+ exit 0+ fi++ ./gradlew "${gradle_args[@]}" -PskipDockerTests=false -PskipWeb=true++ - name: Upload contrib catalog test reports+ uses: actions/upload-artifact@v7+ if: ${{ (failure() && steps.contribCatalogTest.outcome == 'failure') || contains(github.event.pull_request.labels.*.name, 'upload log') }}+ with:+ name: contrib-catalog-test-reports+ path: |+ build/reports+ catalogs-contrib/**/*.log+ catalogs-contrib/**/*.tar