|
| 1 | +name: Test Object Storage Adapter |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + INT_TEST_JAVA_RUNTIME_VERSION: |
| 7 | + description: JDK version used to run the integration test |
| 8 | + type: choice |
| 9 | + required: false |
| 10 | + default: '8' |
| 11 | + options: |
| 12 | + - '8' |
| 13 | + - '11' |
| 14 | + - '17' |
| 15 | + - '21' |
| 16 | + INT_TEST_JAVA_RUNTIME_VENDOR: |
| 17 | + description: Vendor of the JDK used to run the integration test |
| 18 | + type: choice |
| 19 | + required: false |
| 20 | + default: 'temurin' |
| 21 | + options: |
| 22 | + - 'corretto' |
| 23 | + - 'microsoft' |
| 24 | + - 'oracle' |
| 25 | + - 'temurin' |
| 26 | + |
| 27 | +env: |
| 28 | + TERM: dumb |
| 29 | + JAVA_VERSION: '8' |
| 30 | + JAVA_VENDOR: 'temurin' |
| 31 | + INT_TEST_JAVA_RUNTIME_VERSION: "${{ github.event_name != 'workflow_dispatch' && '8' || inputs.INT_TEST_JAVA_RUNTIME_VERSION }}" |
| 32 | + INT_TEST_JAVA_RUNTIME_VENDOR: "${{ github.event_name != 'workflow_dispatch' && 'temurin' || inputs.INT_TEST_JAVA_RUNTIME_VENDOR }}" |
| 33 | + # Gradle will parse 'ORG_GRADLE_PROJECT_<project_property_name>' environment variables as project properties. |
| 34 | + # The following variables configure the 'com.scalar.db.jdk-configuration' Gradle plugin. |
| 35 | + ORG_GRADLE_PROJECT_javaVersion: '8' |
| 36 | + ORG_GRADLE_PROJECT_javaVendor: 'temurin' |
| 37 | + ORG_GRADLE_PROJECT_integrationTestJavaRuntimeVersion: "${{ github.event_name != 'workflow_dispatch' && '8' || inputs.INT_TEST_JAVA_RUNTIME_VERSION }}" |
| 38 | + ORG_GRADLE_PROJECT_integrationTestJavaRuntimeVendor: "${{ github.event_name != 'workflow_dispatch' && 'temurin' || inputs.INT_TEST_JAVA_RUNTIME_VENDOR }}" |
| 39 | + # This variable evaluates to: if {!(Temurin JDK 8) && !(Oracle JDK)} then {true} else {false} |
| 40 | + # Oracle JDK that are linux compatible and publicly available through direct download exist for all LTS versions |
| 41 | + SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK: "${{ (github.event_name == 'workflow_dispatch' && !(inputs.INT_TEST_JAVA_RUNTIME_VERSION == '8' && inputs.INT_TEST_JAVA_RUNTIME_VENDOR == 'temurin') && !(inputs.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle')) && 'true' || 'false' }}" |
| 42 | + INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT: '"-Dscalardb.consensus_commit.coordinator.group_commit.enabled=true" "-Dscalardb.consensus_commit.coordinator.group_commit.old_group_abort_timeout_millis=15000" --tests "**.ConsensusCommit**"' |
| 43 | + CLOUD_STORAGE_PROJECT_ID: ${{ secrets.CLOUD_STORAGE_PROJECT_ID }} |
| 44 | + CLOUD_STORAGE_SERVICE_ACCOUNT_KEY: ${{ secrets.CLOUD_STORAGE_SERVICE_ACCOUNT_KEY }} |
| 45 | + CLOUD_STORAGE_BUCKET_BASE_NAME: scalardb-test-bucket |
| 46 | + |
| 47 | +jobs: |
| 48 | + integration-test-cloud-storage: |
| 49 | + name: Cloud Storage integration test (${{ matrix.test_group.label }}) |
| 50 | + runs-on: ubuntu-latest |
| 51 | + |
| 52 | + strategy: |
| 53 | + fail-fast: false |
| 54 | + matrix: |
| 55 | + test_group: |
| 56 | + - label: storage_scan |
| 57 | + tests_filter: '--tests "**.ObjectStorageSingle**" --tests "**.ObjectStorageMultiple**"' |
| 58 | + bucket_suffix: storage-scan |
| 59 | + group_commit_enabled: false |
| 60 | + - label: storage_wrapper |
| 61 | + tests_filter: '--tests "**.ObjectStorageWrapper**"' |
| 62 | + bucket_suffix: storage-wrapper |
| 63 | + group_commit_enabled: false |
| 64 | + - label: storage_admin |
| 65 | + tests_filter: '--tests "**.ObjectStorageAdmin**"' |
| 66 | + bucket_suffix: storage-admin |
| 67 | + group_commit_enabled: false |
| 68 | + - label: storage_cm |
| 69 | + tests_filter: '--tests "**.ObjectStorageConditionalMutation**"' |
| 70 | + bucket_suffix: storage-cm |
| 71 | + group_commit_enabled: false |
| 72 | + - label: storage_others |
| 73 | + tests_filter: '--tests "**.ObjectStorage**" --tests "!**.ObjectStorageSingle**" --tests "!**.ObjectStorageMultiple**" --tests "!**.ObjectStorageWrapper**" --tests "!**.ObjectStorageAdmin**" --tests "!**.ObjectStorageConditionalMutation**"' |
| 74 | + bucket_suffix: storage |
| 75 | + group_commit_enabled: false |
| 76 | + - label: single_crud_operation_transaction |
| 77 | + tests_filter: '--tests "**.SingleCrudOperationTransaction**"' |
| 78 | + bucket_suffix: single-crud |
| 79 | + group_commit_enabled: false |
| 80 | + |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v5 |
| 83 | + |
| 84 | + - name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }}) |
| 85 | + uses: actions/setup-java@v5 |
| 86 | + with: |
| 87 | + java-version: ${{ env.JAVA_VERSION }} |
| 88 | + distribution: ${{ env.JAVA_VENDOR }} |
| 89 | + |
| 90 | + - name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test |
| 91 | + uses: actions/setup-java@v5 |
| 92 | + if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}} |
| 93 | + with: |
| 94 | + java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} |
| 95 | + distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }} |
| 96 | + |
| 97 | + - name: Login to Oracle container registry |
| 98 | + uses: docker/login-action@v3 |
| 99 | + if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }} |
| 100 | + with: |
| 101 | + registry: container-registry.oracle.com |
| 102 | + username: ${{ secrets.OCR_USERNAME }} |
| 103 | + password: ${{ secrets.OCR_TOKEN }} |
| 104 | + |
| 105 | + - name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test |
| 106 | + if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }} |
| 107 | + run: | |
| 108 | + container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}") |
| 109 | + docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id" |
| 110 | + - name: Setup Gradle |
| 111 | + uses: gradle/actions/setup-gradle@v5 |
| 112 | + |
| 113 | + - name: Execute Gradle 'integrationTestObjectStorage' task |
| 114 | + run: ./gradlew integrationTestObjectStorage -Dscalardb.object_storage.storage=cloud-storage -Dscalardb.object_storage.endpoint=${{ env.CLOUD_STORAGE_BUCKET_BASE_NAME }}-${{ matrix.test_group.bucket_suffix }} -Dscalardb.object_storage.username='${{ env.CLOUD_STORAGE_PROJECT_ID }}' -Dscalardb.object_storage.password='${{ env.CLOUD_STORAGE_SERVICE_ACCOUNT_KEY }}' ${{ matrix.test_group.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }} ${{ matrix.test_group.tests_filter }} |
| 115 | + |
| 116 | + - name: Upload Gradle test reports |
| 117 | + if: always() |
| 118 | + uses: actions/upload-artifact@v5 |
| 119 | + with: |
| 120 | + name: cloud_storage_integration_test_reports_${{ matrix.test_group.label }} |
| 121 | + path: core/build/reports/tests/integrationTestObjectStorage |
0 commit comments