From cdd6f3f2847597bf014a9a180e3c6364f42332cd Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Apr 2024 10:50:19 -0400 Subject: [PATCH] Add a test configuration for retries --- .github/workflows/retries.yaml | 44 +++++++++++++++++++++++++++++++++ .kokoro/retries.sh | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/workflows/retries.yaml create mode 100644 .kokoro/retries.sh diff --git a/.github/workflows/retries.yaml b/.github/workflows/retries.yaml new file mode 100644 index 000000000..6e6a08e2c --- /dev/null +++ b/.github/workflows/retries.yaml @@ -0,0 +1,44 @@ +# Copyright 2023 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 +# +# 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + push: + branches: + - main + pull_request: +name: conformance +jobs: + conformance: + runs-on: ubuntu-latest + strategy: + matrix: + node: [ 14, 16, 18, 20 ] + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: googleapis/cloud-bigtable-clients-test + ref: main + path: cloud-bigtable-clients-test + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - uses: actions/setup-go@v5 + with: + go-version: '>=1.20.2' + - run: chmod +x .kokoro/retries.sh + - run: npm install + - run: go version + - run: .kokoro/retries.sh diff --git a/.kokoro/retries.sh b/.kokoro/retries.sh new file mode 100644 index 000000000..5dd0574ce --- /dev/null +++ b/.kokoro/retries.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Copyright 2023 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 +# +# 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. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global + +## cd to the parent directory, i.e. the root of the git repo +cd $(dirname $0)/.. + +# Stop the testbench & cleanup environment variables +function cleanup() { + echo "Cleanup testbench" + # Stop the proxy + kill $proxyPID +} +trap cleanup EXIT + +# Build and start the proxy in a separate process +pushd . +npm install +nohup npm run testproxy & +proxyPID=$! +popd + +# Run the conformance test +cd cloud-bigtable-clients-test/tests +eval "go test -v -proxy_addr=:9999 -run TestReadRows_NoRetry_ErrorAfterLastRow\|TestReadRows_Retry_LastScannedRow\|TestReadRows_NoRetry_OutOfOrderError\|TestReadRows_Generic_MultiStreams\|TestReadRows_Generic_Headers" +RETURN_CODE=$? + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} \ No newline at end of file