Skip to content

Spanner Staging integration tests #91

Spanner Staging integration tests

Spanner Staging integration tests #91

# Copyright 2024 Google LLC
#
# 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
#
# https://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: Spanner Staging integration tests
on:
pull_request:
branches:
- 'main'
paths:
- '.github/workflows/spanner-staging-tests.yml'
inputs:
spannerHost:
description: 'Spanner host URL.'
type: string
required: false
default: 'https://staging-wrenchworks.sandbox.googleapis.com'
workflow_dispatch:
inputs:
commitOrTag:
description: 'Commit hash or release tag to checkout. Leave blank to checkout the most recent commit on main branch.'
type: string
required: false
default: ''
spannerHost:
description: 'Spanner host URL.'
type: string
required: false
default: ''
permissions: write-all
jobs:
spanner_java_integration_tests_templates:
name: Spanner Dataflow Templates Integration Tests
timeout-minutes: 180
# Run on any runner that matches all the specified runs-on values.
runs-on: [ self-hosted, spanner ]
steps:
- name: Checkout Code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
ref: ${{ inputs.commitOrTag }}
- name: Setup Environment
id: setup-env
uses: ./.github/actions/setup-env
- name: Run Integration Tests
run: |
./cicd/run-spanner-staging-it-tests \
--modules-to-build="v1" \
--it-region="us-central1" \
--it-project="span-cloud-migrations-staging" \
--it-artifact-bucket="dataflow-testing-it-spanner-staging" \
--it-spanner-host=${{ inputs.spannerHost }}
- name: Upload Integration Tests Report
uses: actions/upload-artifact@v4
if: always() # always run even if the previous step fails
with:
name: surefire-test-results
path: '**/surefire-reports/TEST-*.xml'
retention-days: 20
- name: Integration Test report on GitHub
uses: dorny/test-reporter@v1
if: always()
with:
name: Integration Test report on GitHub
path: '**/surefire-reports/TEST-*.xml'
reporter: java-junit
only-summary: 'false'
token: ${{ secrets.GITHUB_TOKEN }}
fail-on-error: 'false'
- name: Cleanup Java Environment
uses: ./.github/actions/cleanup-java-env