diff --git a/.github/workflows/mandatory-conformance.yaml b/.github/workflows/mandatory-conformance.yaml new file mode 100644 index 000000000..781612705 --- /dev/null +++ b/.github/workflows/mandatory-conformance.yaml @@ -0,0 +1,44 @@ +# 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 +# +# 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: mandatory-conformance +jobs: + mandatory-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/mandatory-conformance.sh + - run: npm install + - run: go version + - run: .kokoro/mandatory-conformance.sh diff --git a/.kokoro/mandatory-conformance.sh b/.kokoro/mandatory-conformance.sh new file mode 100644 index 000000000..81a8a9d82 --- /dev/null +++ b/.kokoro/mandatory-conformance.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# 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 +# +# 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 skipping known failures +cd cloud-bigtable-clients-test/tests +eval "go test -v -proxy_addr=:9999 -skip `tr -d '\n' < ../../testproxy/known_failures.txt`" +RETURN_CODE=$? + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/testproxy/known_failures.txt b/testproxy/known_failures.txt index cce1bd7fa..0dfeb8b9e 100644 --- a/testproxy/known_failures.txt +++ b/testproxy/known_failures.txt @@ -1 +1,29 @@ -TestMutateRow_Generic_Headers\|TestMutateRow_Generic_DeadlineExceeded|TestMutateRows_Generic_CloseClient\|TestMutateRows_Retry_WithRoutingCookie\|TestReadModifyWriteRow_Generic_Headers\|TestReadModifyWriteRow_NoRetry_TransientError\|TestReadModifyWriteRow_Generic_DeadlineExceeded\|TestReadRow_Generic_DeadlineExceeded\|TestReadRow_Retry_WithRoutingCookie\|TestReadRow_Retry_WithRetryInfo\|TestReadRows_ReverseScans_FeatureFlag_Enabled\|TestReadRows_NoRetry_OutOfOrderError_Reverse\|TestReadRows_Retry_PausedScan\|TestReadRows_Retry_LastScannedRow\|TestReadRows_Retry_LastScannedRow_Reverse\|TestCheckAndMutateRow_NoRetry_TransientError\|TestCheckAndMutateRow_Generic_DeadlineExceeded \ No newline at end of file +TestMutateRow_Generic_Headers\| +TestMutateRow_Generic_DeadlineExceeded\| +TestMutateRows_Generic_CloseClient\| +TestMutateRows_Retry_WithRoutingCookie\| +TestMutateRows_Generic_DeadlineExceeded\| +TestReadModifyWriteRow_Generic_Headers\| +TestReadModifyWriteRow_NoRetry_TransientError\| +TestReadModifyWriteRow_Generic_DeadlineExceeded\| +TestReadRow_Generic_DeadlineExceeded\| +TestReadRow_Retry_WithRoutingCookie\| +TestReadRow_Retry_WithRetryInfo\| +TestReadRows_ReverseScans_FeatureFlag_Enabled\| +TestReadRows_NoRetry_OutOfOrderError_Reverse\| +TestReadRows_Retry_PausedScan\| +TestReadRows_Retry_LastScannedRow\| +TestReadRows_Retry_LastScannedRow_Reverse\| +TestReadRows_Retry_StreamReset\| +TestReadRows_Generic_CloseClient\| +TestReadRows_Generic_DeadlineExceeded\| +TestReadRows_Retry_WithRoutingCookie\| +TestReadRows_Retry_WithRoutingCookie_MultipleErrorResponses\| +TestReadRows_Retry_WithRetryInfo\| +TestReadRows_Retry_WithRetryInfo_MultipleErrorResponse\| +TestCheckAndMutateRow_NoRetry_TransientError\| +TestCheckAndMutateRow_Generic_DeadlineExceeded\| +TestCheckAndMutateRow_Generic_Headers\| +TestSampleRowKeys_Generic_Headers\| +TestSampleRowKeys_Generic_DeadlineExceeded\| +TestSampleRowKeys_Retry_WithRoutingCookie