|
| 1 | +name: Spanner Thread Count Benchmark |
| 2 | +run-name: "Spanner Thread Benchmark" |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + push: |
| 7 | + |
| 8 | +env: |
| 9 | + SPANNER_JDBC_URL: "jdbc:cloudspanner://localhost:9010/projects/emulator-project/instances/test-instance/databases/test-db;autoConfigEmulator=true;dialect=POSTGRESQL" |
| 10 | + |
| 11 | +jobs: |
| 12 | + benchmark: |
| 13 | + name: "${{ matrix.test_class }} threads=${{ matrix.thread_num }}" |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + test_class: |
| 19 | + - JdbcDatabaseConditionalMutationIntegrationTest |
| 20 | + - JdbcDatabaseMultipleClusteringKeyScanIntegrationTest |
| 21 | + thread_num: [1, 2, 3, 4, 5, 6] |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v6 |
| 24 | + |
| 25 | + - name: Install and start Spanner emulator |
| 26 | + run: | |
| 27 | + echo "deb [signed-by=/usr/share/keyrings/cloud.google.asc] https://packages.cloud.google.com/apt cloud-sdk main" \ |
| 28 | + | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list |
| 29 | + curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \ |
| 30 | + | sudo tee /usr/share/keyrings/cloud.google.asc > /dev/null |
| 31 | + sudo apt-get update -qq |
| 32 | + sudo apt-get install -y -qq google-cloud-cli-spanner-emulator |
| 33 | + EMULATOR_DIR=/usr/lib/google-cloud-sdk/bin/cloud_spanner_emulator |
| 34 | + ${EMULATOR_DIR}/gateway_main \ |
| 35 | + --hostname 0.0.0.0 \ |
| 36 | + --grpc_port 9010 \ |
| 37 | + --http_port 9020 \ |
| 38 | + --grpc_binary ${EMULATOR_DIR}/emulator_main \ |
| 39 | + & |
| 40 | + until curl -sf http://localhost:9020/v1/projects/emulator-project/instances > /dev/null 2>&1; do sleep 1; done |
| 41 | +
|
| 42 | + - name: Set up JDK 8 |
| 43 | + uses: actions/setup-java@v5 |
| 44 | + with: |
| 45 | + java-version: 8 |
| 46 | + distribution: temurin |
| 47 | + |
| 48 | + - name: Setup Gradle |
| 49 | + uses: gradle/actions/setup-gradle@v5 |
| 50 | + |
| 51 | + - name: Run ${{ matrix.test_class }} with ${{ matrix.thread_num }} threads |
| 52 | + env: |
| 53 | + SCALARDB_INTEGRATION_TEST_THREAD_NUM: ${{ matrix.thread_num }} |
| 54 | + ORG_GRADLE_PROJECT_javaVersion: '8' |
| 55 | + ORG_GRADLE_PROJECT_javaVendor: 'temurin' |
| 56 | + ORG_GRADLE_PROJECT_integrationTestJavaRuntimeVersion: '8' |
| 57 | + ORG_GRADLE_PROJECT_integrationTestJavaRuntimeVendor: 'temurin' |
| 58 | + run: | |
| 59 | + ./gradlew core:integrationTestJdbc \ |
| 60 | + "-Dscalardb.jdbc.url=${SPANNER_JDBC_URL}" \ |
| 61 | + --tests ${{ matrix.test_class }} |
| 62 | +
|
| 63 | + - name: Upload test report |
| 64 | + if: always() |
| 65 | + uses: actions/upload-artifact@v7 |
| 66 | + with: |
| 67 | + name: benchmark_${{ matrix.test_class }}_threads_${{ matrix.thread_num }} |
| 68 | + path: core/build/reports/tests/ |
0 commit comments