This repository was archived by the owner on Apr 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·61 lines (53 loc) · 1.82 KB
/
run_tests.sh
File metadata and controls
executable file
·61 lines (53 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/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
#
# https://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
# attempt download golang if not found
if [[ ! -x "$(command -v go)" ]]; then
echo "Downloading golang..."
wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
tar -xzf go1.20.2.linux-amd64.tar.gz
export GOROOT=$(pwd)/go
export PATH=$GOROOT/bin:$PATH
export GOPATH=$HOME/go
go version
fi
# ensure the working dir is the script's folder
SCRIPT_DIR=$(realpath $(dirname "$0"))
cd $SCRIPT_DIR
export PROXY_SERVER_PORT=$(shuf -i 50000-60000 -n 1)
# download test suite
if [ ! -d "cloud-bigtable-clients-test" ]; then
git clone https://github.com/googleapis/cloud-bigtable-clients-test.git
fi
# start proxy
echo "starting with client type: $CLIENT_TYPE"
python test_proxy.py --port $PROXY_SERVER_PORT --client_type $CLIENT_TYPE &
PROXY_PID=$!
function finish {
kill $PROXY_PID
}
trap finish EXIT
if [[ $CLIENT_TYPE == "legacy" ]]; then
echo "Using legacy client"
# legacy client does not expose mutate_row. Disable those tests
TEST_ARGS="-skip TestMutateRow_"
fi
if [[ $CLIENT_TYPE != "async" ]]; then
echo "Using legacy client"
# sync and legacy client do not support concurrent streams
TEST_ARGS="$TEST_ARGS -skip _Generic_MultiStream "
fi
# run tests
pushd cloud-bigtable-clients-test/tests
echo "Running with $TEST_ARGS"
go test -v -proxy_addr=:$PROXY_SERVER_PORT $TEST_ARGS