Skip to content

Commit 29fb7dd

Browse files
committed
tests: fix test
1 parent 7f2d9e2 commit 29fb7dd

1 file changed

Lines changed: 20 additions & 23 deletions

File tree

packages/google-cloud-bigtable/test_proxy/run_tests.sh

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,32 @@ fi
2727
SCRIPT_DIR=$(realpath $(dirname "$0"))
2828
cd $SCRIPT_DIR
2929

30-
export PROXY_SERVER_PORT=$(shuf -i 50000-60000 -n 1)
30+
export PROXY_PORT=$(shuf -i 50000-60000 -n 1)
3131

3232
# download test suite
3333
if [ ! -d "cloud-bigtable-clients-test" ]; then
3434
git clone https://github.com/googleapis/cloud-bigtable-clients-test.git
3535
fi
3636

37-
# start proxy
38-
echo "starting with client type: $CLIENT_TYPE"
39-
python test_proxy.py --port $PROXY_SERVER_PORT --client_type $CLIENT_TYPE &
40-
PROXY_PID=$!
41-
function finish {
42-
kill $PROXY_PID
43-
}
44-
trap finish EXIT
45-
46-
if [[ $CLIENT_TYPE == "legacy" ]]; then
47-
echo "Using legacy client"
48-
# legacy client does not expose mutate_row. Disable those tests
49-
TEST_ARGS="-skip TestMutateRow_"
50-
fi
37+
# Build and start the proxy in a separate process
38+
pushd test_proxy
39+
nohup python3 test_proxy.py --port $PROXY_PORT --client_type=$CLIENT_TYPE &
40+
proxyPID=$!
41+
popd
5142

52-
if [[ $CLIENT_TYPE != "async" ]]; then
53-
echo "Using legacy client"
54-
# sync and legacy client do not support concurrent streams
55-
TEST_ARGS="$TEST_ARGS -skip _Generic_MultiStream "
56-
fi
43+
# Kill proxy on exit
44+
function cleanup() {
45+
echo "Cleanup testbench";
46+
kill $proxyPID
47+
}
48+
trap cleanup EXIT
5749

58-
# run tests
50+
# Run the conformance test
51+
echo "running tests with args: $TEST_ARGS"
5952
pushd cloud-bigtable-clients-test/tests
60-
echo "Running with $TEST_ARGS"
61-
go test -v -proxy_addr=:$PROXY_SERVER_PORT $TEST_ARGS
53+
eval "go test -v -proxy_addr=:$PROXY_PORT $TEST_ARGS"
54+
RETURN_CODE=$?
55+
popd
56+
57+
echo "exiting with ${RETURN_CODE}"
58+
exit ${RETURN_CODE}

0 commit comments

Comments
 (0)