File tree Expand file tree Collapse file tree
packages/google-cloud-bigtable/test_proxy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727SCRIPT_DIR=$( realpath $( dirname " $0 " ) )
2828cd $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
3333if [ ! -d " cloud-bigtable-clients-test" ]; then
3434 git clone https://github.com/googleapis/cloud-bigtable-clients-test.git
3535fi
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 "
5952pushd 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}
You can’t perform that action at this time.
0 commit comments