generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 178
Add workflow for SQL CLI integration tests #4770
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
Open
Swiddis
wants to merge
7
commits into
opensearch-project:main
Choose a base branch
from
Swiddis:feature/sql-cli-integ
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5ae2b06
Add workflow for SQL CLI integration tests
Swiddis 317f675
Switch SQL checkout path for CLI
Swiddis c8e479e
Tweak paths and mkdir for remote
Swiddis 386d210
Fix filename
Swiddis d84fc43
Remove redundant verification
Swiddis 5c5591e
Don't pull after clone
Swiddis 9ddbdad
Merge remote-tracking branch 'upstream/main' into feature/sql-cli-integ
Swiddis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why do we need these paths, why shouldn't we run this for all updates (except docs)? can path-ignore be shorter here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nice to have if we only match what we need, I updated these to match what we have for
sql-test-and-build-workflowinstead.