Skip to content

Commit

Permalink
add conformance tests github action config
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Oct 5, 2023
1 parent 8708a25 commit b540355
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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.7, 3.11 ]
use-legacy-client: [ "false", "true" ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
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 .
- run: go version
- run: .kokoro/conformance.sh
name: "Conformance Tests"
env:
USE_LEGACY_CLIENT: ${{ matrix.use-legacy-client }}

48 changes: 48 additions & 0 deletions .kokoro/conformance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/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)/..

ARGS=""
if [[ "$USE_LEGACY_CLIENT" == "true" ]]; then
ARGS="--legacy-client"
echo "Using legacy client"
fi

# Build and start the proxy in a separate process
PROXY_PORT=9999
pushd test_proxy
nohup python testproxy --port $PROXY_PORT $ARGS &
proxyPID=$!
popd

# Run the conformance test
pushd .
pwd
ls
cd cloud-bigtable-clients-test/tests
eval "go test -v -proxy_addr=:$PROXY_PORT"
RETURN_CODE=$?
popd

# Stop the proxy
kill $proxyPID

echo "exiting with ${RETURN_CODE}"
exit ${RETURN_CODE}

0 comments on commit b540355

Please sign in to comment.