-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): add conformance tests to CI for v3 (#870)
- Loading branch information
1 parent
8708a25
commit 1d3a7c1
Showing
6 changed files
with
262 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# 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: | ||
py-version: [ 3.8 ] | ||
client-type: [ "Async v3", "Legacy" ] | ||
name: "${{ matrix.client-type }} Client / Python ${{ matrix.py-version }}" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: "Checkout python-bigtable" | ||
- uses: actions/checkout@v3 | ||
name: "Checkout conformance tests" | ||
with: | ||
repository: googleapis/cloud-bigtable-clients-test | ||
ref: main | ||
path: cloud-bigtable-clients-test | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.py-version }} | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '>=1.20.2' | ||
- run: chmod +x .kokoro/conformance.sh | ||
- run: pip install -e . | ||
name: "Install python-bigtable from HEAD" | ||
- run: go version | ||
- run: .kokoro/conformance.sh | ||
name: "Run tests" | ||
env: | ||
CLIENT_TYPE: ${{ matrix.client-type }} | ||
PYTHONUNBUFFERED: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/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 | ||
|
||
## cd to the parent directory, i.e. the root of the git repo | ||
cd $(dirname $0)/.. | ||
|
||
PROXY_ARGS="" | ||
TEST_ARGS="" | ||
if [[ "${CLIENT_TYPE^^}" == "LEGACY" ]]; then | ||
echo "Using legacy client" | ||
PROXY_ARGS="--legacy-client" | ||
# legacy client does not expose mutate_row. Disable those tests | ||
TEST_ARGS="-skip TestMutateRow_" | ||
fi | ||
|
||
# Build and start the proxy in a separate process | ||
PROXY_PORT=9999 | ||
pushd test_proxy | ||
nohup python test_proxy.py --port $PROXY_PORT $PROXY_ARGS & | ||
proxyPID=$! | ||
popd | ||
|
||
# Kill proxy on exit | ||
function cleanup() { | ||
echo "Cleanup testbench"; | ||
kill $proxyPID | ||
} | ||
trap cleanup EXIT | ||
|
||
# Run the conformance test | ||
pushd cloud-bigtable-clients-test/tests | ||
eval "go test -v -proxy_addr=:$PROXY_PORT $TEST_ARGS" | ||
RETURN_CODE=$? | ||
popd | ||
|
||
echo "exiting with ${RETURN_CODE}" | ||
exit ${RETURN_CODE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This constraints file is used to check that lower bounds | ||
# are correct in setup.py | ||
# List *all* library dependencies and extras in this file. | ||
# Pin the version to the lower bound. | ||
# | ||
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", | ||
# Then this file should have foo==1.14.0 | ||
google-api-core==2.12.0.dev1 | ||
google-cloud-core==2.3.2 | ||
grpc-google-iam-v1==0.12.4 | ||
proto-plus==1.22.0 | ||
libcst==0.2.5 | ||
protobuf==3.19.5 |