diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d5fbbb6f1..a37e3c85ab 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1741,6 +1741,138 @@ jobs: name: db2_12.1_integration_test_reports_${{ matrix.mode.label }} path: core/build/reports/tests/integrationTestJdbc + integration-test-for-alloydb-15: + name: AlloyDB 15 integration test (${{ matrix.mode.label }}) + runs-on: ubuntu-latest + + services: + alloydb: + image: google/alloydbomni:15 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_INITDB_ARGS: "--icu-locale=en-US-u-va-posix" + ports: + - 5432:5432 + + strategy: + fail-fast: false + matrix: + mode: + - label: default + group_commit_enabled: false + - label: with_group_commit + group_commit_enabled: true + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }}) + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.JAVA_VENDOR }} + + - name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test + uses: actions/setup-java@v4 + if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}} + with: + java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} + distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }} + + - name: Login to Oracle container registry + uses: docker/login-action@v3 + if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }} + with: + registry: container-registry.oracle.com + username: ${{ secrets.OCR_USERNAME }} + password: ${{ secrets.OCR_TOKEN }} + + - name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test + if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }} + run: | + container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}") + docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Execute Gradle 'integrationTestJdbc' task + run: ./gradlew integrationTestJdbc -Dscalardb.jdbc.url=jdbc:postgresql://localhost:5432/ -Dscalardb.jdbc.username=postgres -Dscalardb.jdbc.password=postgres ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }} + + - name: Upload Gradle test reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: alloydb_15_integration_test_reports_${{ matrix.mode.label }} + path: core/build/reports/tests/integrationTestJdbc + + integration-test-for-alloydb-16: + name: AlloyDB 16 integration test (${{ matrix.mode.label }}) + runs-on: ubuntu-latest + + services: + alloydb: + image: google/alloydbomni:16 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_INITDB_ARGS: "--icu-locale=en-US-u-va-posix" + ports: + - 5432:5432 + + strategy: + fail-fast: false + matrix: + mode: + - label: default + group_commit_enabled: false + - label: with_group_commit + group_commit_enabled: true + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }}) + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.JAVA_VENDOR }} + + - name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test + uses: actions/setup-java@v4 + if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}} + with: + java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} + distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }} + + - name: Login to Oracle container registry + uses: docker/login-action@v3 + if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }} + with: + registry: container-registry.oracle.com + username: ${{ secrets.OCR_USERNAME }} + password: ${{ secrets.OCR_TOKEN }} + + - name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test + if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }} + run: | + container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}") + docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Execute Gradle 'integrationTestJdbc' task + run: ./gradlew integrationTestJdbc -Dscalardb.jdbc.url=jdbc:postgresql://localhost:5432/ -Dscalardb.jdbc.username=postgres -Dscalardb.jdbc.password=postgres ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }} + + - name: Upload Gradle test reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: alloydb_16_integration_test_reports_${{ matrix.mode.label }} + path: core/build/reports/tests/integrationTestJdbc + integration-test-for-multi-storage: name: Multi-storage integration test (${{ matrix.mode.label }}) runs-on: ubuntu-latest diff --git a/build.gradle b/build.gradle index db714fe7c5..a840a461d2 100644 --- a/build.gradle +++ b/build.gradle @@ -39,6 +39,7 @@ subprojects { yugabyteDriverVersion = '42.7.3-yb-4' db2DriverVersion = '12.1.2.0' mariadDbDriverVersion = '3.5.6' + alloyDbJdbcConnectorVersion = '1.2.6' picocliVersion = '4.7.7' commonsTextVersion = '1.14.0' junitVersion = '5.14.0' diff --git a/core/build.gradle b/core/build.gradle index d102daef09..63292e79cd 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -173,6 +173,8 @@ dependencies { implementation ("org.mariadb.jdbc:mariadb-java-client:${mariadDbDriverVersion}") { exclude group: 'org.slf4j', module: 'slf4j-api' } + // The Java connector library used to establish simply a secure connection to AlloyDB on GCP + implementation("com.google.cloud:alloydb-jdbc-connector:${alloyDbJdbcConnectorVersion}") implementation "org.apache.commons:commons-text:${commonsTextVersion}" testImplementation platform("org.junit:junit-bom:${junitVersion}") testImplementation 'org.junit.jupiter:junit-jupiter'