From 5ae2b06afc1bb5adf0b19bd4f0fe9744898599af Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Mon, 10 Nov 2025 19:07:47 +0000 Subject: [PATCH 1/6] Add workflow for SQL CLI integration tests Signed-off-by: Simeon Widdis --- .../workflows/sql-cli-integration-test.yml | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .github/workflows/sql-cli-integration-test.yml diff --git a/.github/workflows/sql-cli-integration-test.yml b/.github/workflows/sql-cli-integration-test.yml new file mode 100644 index 0000000000..8ea621c71f --- /dev/null +++ b/.github/workflows/sql-cli-integration-test.yml @@ -0,0 +1,103 @@ +name: SQL CLI Integration Test + +# This workflow tests sql-cli against the current SQL changes +# to catch breaking changes before they're published + +on: + pull_request: + paths: + - 'api/**' + - 'sql/**' + - 'ppl/**' + - 'core/**' + - 'opensearch/**' + - 'common/**' + - 'protocol/**' + - '**/*.gradle' + - '.github/workflows/sql-cli-integration-test.yml' + push: + branches: + - main + - '[0-9]+.[0-9]+' + - '[0-9]+.x' + paths: + - 'api/**' + - 'sql/**' + - 'ppl/**' + - 'core/**' + - 'opensearch/**' + - 'common/**' + - 'protocol/**' + - '**/*.gradle' + - '.github/workflows/sql-cli-integration-test.yml' + workflow_dispatch: + +jobs: + test-sql-cli-integration: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [21] + + steps: + - name: Checkout SQL repository (current changes) + uses: actions/checkout@v4 + with: + path: sql + + - name: Checkout SQL CLI repository (latest main) + uses: actions/checkout@v4 + with: + repository: opensearch-project/sql-cli + path: sql-cli + ref: main + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + + - name: Build and publish SQL modules to Maven Local + working-directory: sql + run: | + echo "Building SQL modules from current branch..." + ./gradlew publishToMavenLocal -x test -x integTest + echo "SQL modules published to Maven Local" + + - name: Verify SQL CLI settings.gradle exists + working-directory: sql-cli + run: | + if [ ! -f "settings.gradle" ]; then + echo "ERROR: settings.gradle not found in sql-cli repository" + echo "The composite build configuration may not be merged yet." + echo "This workflow requires the composite build setup to work." + exit 1 + fi + echo "settings.gradle found, proceeding with tests" + + - name: Run SQL CLI tests with local SQL modules + working-directory: sql-cli + run: | + echo "Running SQL CLI tests against local SQL modules..." + ./gradlew clean test -PuseLocalSql=true --info --stacktrace + + - name: Upload SQL CLI test reports + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: sql-cli-test-reports-java-${{ matrix.java }} + path: | + sql-cli/build/reports/** + sql-cli/build/test-results/** + + - name: Test Summary + if: always() + run: | + echo "## SQL CLI Integration Test Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Tested SQL CLI against SQL changes from: \`${{ github.ref }}\`" >> $GITHUB_STEP_SUMMARY + echo "SQL CLI version: main branch (latest)" >> $GITHUB_STEP_SUMMARY + echo "Java version: ${{ matrix.java }}" >> $GITHUB_STEP_SUMMARY From 317f6752f93ac71ba3ff8e1aa24697bf49cea6bc Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Tue, 11 Nov 2025 19:52:18 +0000 Subject: [PATCH 2/6] Switch SQL checkout path for CLI Signed-off-by: Simeon Widdis --- .github/workflows/sql-cli-integration-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sql-cli-integration-test.yml b/.github/workflows/sql-cli-integration-test.yml index 8ea621c71f..6dca233731 100644 --- a/.github/workflows/sql-cli-integration-test.yml +++ b/.github/workflows/sql-cli-integration-test.yml @@ -41,11 +41,6 @@ jobs: java: [21] steps: - - name: Checkout SQL repository (current changes) - uses: actions/checkout@v4 - with: - path: sql - - name: Checkout SQL CLI repository (latest main) uses: actions/checkout@v4 with: @@ -53,6 +48,11 @@ jobs: path: sql-cli ref: main + - name: Checkout SQL repository (current changes) + uses: actions/checkout@v4 + with: + path: sql-cli/remote/sql + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v4 with: @@ -60,7 +60,7 @@ jobs: java-version: ${{ matrix.java }} - name: Build and publish SQL modules to Maven Local - working-directory: sql + working-directory: sql-cli/remote/sql run: | echo "Building SQL modules from current branch..." ./gradlew publishToMavenLocal -x test -x integTest From c8e479eca0caaf175e5a3ae122d95fa771c2be5d Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Tue, 11 Nov 2025 21:33:17 +0000 Subject: [PATCH 3/6] Tweak paths and mkdir for remote Signed-off-by: Simeon Widdis --- .../workflows/sql-cli-integration-test.yml | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/sql-cli-integration-test.yml b/.github/workflows/sql-cli-integration-test.yml index 6dca233731..63df24a485 100644 --- a/.github/workflows/sql-cli-integration-test.yml +++ b/.github/workflows/sql-cli-integration-test.yml @@ -6,30 +6,30 @@ name: SQL CLI Integration Test on: pull_request: paths: - - 'api/**' - - 'sql/**' - - 'ppl/**' - - 'core/**' - - 'opensearch/**' - - 'common/**' - - 'protocol/**' - - '**/*.gradle' - - '.github/workflows/sql-cli-integration-test.yml' + - '**/*.java' + - '**/*.g4' + - '!sql-jdbc/**' + - '**gradle*' + - '**lombok*' + - 'integ-test/**' + - '**/*.jar' + - '**/*.pom' + - '.github/workflows/sql-test-and-build-workflow.yml' push: branches: - main - '[0-9]+.[0-9]+' - '[0-9]+.x' paths: - - 'api/**' - - 'sql/**' - - 'ppl/**' - - 'core/**' - - 'opensearch/**' - - 'common/**' - - 'protocol/**' - - '**/*.gradle' - - '.github/workflows/sql-cli-integration-test.yml' + - '**/*.java' + - '**/*.g4' + - '!sql-jdbc/**' + - '**gradle*' + - '**lombok*' + - 'integ-test/**' + - '**/*.jar' + - '**/*.pom' + - '.github/workflows/sql-test-and-build-workflow.yml' workflow_dispatch: jobs: @@ -48,6 +48,10 @@ jobs: path: sql-cli ref: main + - name: Make a directory for the SQL repo + working-directory: sql-cli + run: mkdir remote + - name: Checkout SQL repository (current changes) uses: actions/checkout@v4 with: From 386d210bb814203de7c02182417672f53985b1df Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Tue, 11 Nov 2025 21:36:51 +0000 Subject: [PATCH 4/6] Fix filename Signed-off-by: Simeon Widdis --- .github/workflows/sql-cli-integration-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sql-cli-integration-test.yml b/.github/workflows/sql-cli-integration-test.yml index 63df24a485..f75af99179 100644 --- a/.github/workflows/sql-cli-integration-test.yml +++ b/.github/workflows/sql-cli-integration-test.yml @@ -14,7 +14,7 @@ on: - 'integ-test/**' - '**/*.jar' - '**/*.pom' - - '.github/workflows/sql-test-and-build-workflow.yml' + - '.github/workflows/sql-cli-integration-test.yml' push: branches: - main @@ -29,7 +29,7 @@ on: - 'integ-test/**' - '**/*.jar' - '**/*.pom' - - '.github/workflows/sql-test-and-build-workflow.yml' + - '.github/workflows/sql-cli-integration-test.yml' workflow_dispatch: jobs: From d84fc430291248bcb6283fb52930cf40f2dba438 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Tue, 11 Nov 2025 21:46:27 +0000 Subject: [PATCH 5/6] Remove redundant verification Signed-off-by: Simeon Widdis --- .github/workflows/sql-cli-integration-test.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/sql-cli-integration-test.yml b/.github/workflows/sql-cli-integration-test.yml index f75af99179..f3590e14d9 100644 --- a/.github/workflows/sql-cli-integration-test.yml +++ b/.github/workflows/sql-cli-integration-test.yml @@ -70,22 +70,11 @@ jobs: ./gradlew publishToMavenLocal -x test -x integTest echo "SQL modules published to Maven Local" - - name: Verify SQL CLI settings.gradle exists - working-directory: sql-cli - run: | - if [ ! -f "settings.gradle" ]; then - echo "ERROR: settings.gradle not found in sql-cli repository" - echo "The composite build configuration may not be merged yet." - echo "This workflow requires the composite build setup to work." - exit 1 - fi - echo "settings.gradle found, proceeding with tests" - - name: Run SQL CLI tests with local SQL modules working-directory: sql-cli run: | echo "Running SQL CLI tests against local SQL modules..." - ./gradlew clean test -PuseLocalSql=true --info --stacktrace + ./gradlew test -PuseLocalSql=true - name: Upload SQL CLI test reports if: always() From 5c5591e5e76e570343af20549edf7853a8b2e3a0 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Tue, 11 Nov 2025 22:27:35 +0000 Subject: [PATCH 6/6] Don't pull after clone Signed-off-by: Simeon Widdis --- .github/workflows/sql-cli-integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql-cli-integration-test.yml b/.github/workflows/sql-cli-integration-test.yml index f3590e14d9..63f3e91d33 100644 --- a/.github/workflows/sql-cli-integration-test.yml +++ b/.github/workflows/sql-cli-integration-test.yml @@ -74,7 +74,7 @@ jobs: working-directory: sql-cli run: | echo "Running SQL CLI tests against local SQL modules..." - ./gradlew test -PuseLocalSql=true + ./gradlew test -PuseLocalSql=true -PskipSqlRepoPull=true - name: Upload SQL CLI test reports if: always()