From f9ef67328f41f75d3260dde297a6ce414f11fa1b Mon Sep 17 00:00:00 2001 From: renjiezh <94721804+renjiezh@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:47:46 -0800 Subject: [PATCH] Add release-test into github workflow (#1450) --- .github/workflows/release-test.yml | 70 +++++++++++++++++++ .../integration/deploy/gcloud/BUILD.bazel | 20 ++++-- 2 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/release-test.yml diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 00000000000..b4f55f90efe --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,70 @@ +# Copyright 2024 The Cross-Media Measurement Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Release test + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-test: + name: Build and test + runs-on: ubuntu-20.04 + env: + CLUSTER_LOGS_PATH: cluster-logs + steps: + - name: Check out revision + uses: actions/checkout@v3 + + - uses: ./.github/actions/free-disk-space + + - name: Write ~/.bazelrc + run: | + cat << EOF > ~/.bazelrc + build -c opt + build --host_platform //build/platforms:ubuntu_20_04 + EOF + + - name: Get Bazel cache params + id: get-cache-params + uses: world-federation-of-advertisers/actions/bazel-get-cache-params@v2 + with: + cache-version: 1 + + - name: Restore Bazel cache + uses: actions/cache/restore@v3 + with: + path: ${{ steps.get-cache-params.outputs.cache-path }} + key: ${{ steps.get-cache-params.outputs.cache-key }} + restore-keys: |- + ${{ steps.get-cache-params.outputs.restore-key }} + + - name: Build + run: > + bazelisk build --worker_quit_after_build + //src/test/kotlin/org/wfanet/measurement/integration/deploy/gcloud:GCloudSpannerInProcessReachMeasurementAccuracyTest + + - name: Run tests + id: run-tests + run: > + bazelisk test + //src/test/kotlin/org/wfanet/measurement/integration/deploy/gcloud:GCloudSpannerInProcessReachMeasurementAccuracyTest + --test_output=streamed + + - name: Upload Bazel testlogs + continue-on-error: true + uses: world-federation-of-advertisers/actions/bazel-upload-testlogs@v2 + if: failure() && (steps.run-tests.outcome == 'failure') diff --git a/src/test/kotlin/org/wfanet/measurement/integration/deploy/gcloud/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/integration/deploy/gcloud/BUILD.bazel index 08e036a6684..c500963c03d 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/deploy/gcloud/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/integration/deploy/gcloud/BUILD.bazel @@ -87,18 +87,24 @@ java_test( runtime_deps = [":gcloud_in_process_life_of_a_report_v2_integration_test"], ) -spanner_emulator_test( +kt_jvm_library( + name = "gcloud_spanner_in_process_reach_measurement_accuracy_test", + srcs = ["GCloudSpannerInProcessReachMeasurementAccuracyTest.kt"], + data = ["@cloud_spanner_emulator//:emulator"], + deps = [ + "//src/main/kotlin/org/wfanet/measurement/integration/common:in_process_reach_measurement_accuracy_test", + "//src/main/kotlin/org/wfanet/measurement/integration/deploy/gcloud:spanner_duchy_dependency_provider_rule", + "//src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/testing", + ], +) + +java_test( name = "GCloudSpannerInProcessReachMeasurementAccuracyTest", size = "enormous", - srcs = ["GCloudSpannerInProcessReachMeasurementAccuracyTest.kt"], tags = [ "cpu:2", "manual", ], test_class = "org.wfanet.measurement.integration.deploy.gcloud.GCloudSpannerInProcessReachMeasurementAccuracyTest", - deps = [ - "//src/main/kotlin/org/wfanet/measurement/integration/common:in_process_reach_measurement_accuracy_test", - "//src/main/kotlin/org/wfanet/measurement/integration/deploy/gcloud:spanner_duchy_dependency_provider_rule", - "//src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/testing", - ], + runtime_deps = [":gcloud_spanner_in_process_reach_measurement_accuracy_test"], )