From 1ca65b1176025e4bf0b65b71c7664811664526d1 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Maden Date: Thu, 21 Nov 2019 19:32:02 -0800 Subject: [PATCH] [test/deploy] Fix possible dependency missmatch for tests --- test/deploy.sh | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/test/deploy.sh b/test/deploy.sh index 1d47ce1dc..ef9530c59 100755 --- a/test/deploy.sh +++ b/test/deploy.sh @@ -60,22 +60,32 @@ function cleanup_and_result() { } function debug_staking() { - hmy_one_dir="$(go env GOPATH)/src/github.com/harmony-one" - hmy_bin="${hmy_one_dir}/go-sdk/hmy" - keystore="${hmy_one_dir}/harmony-ops/test-automation/api-tests/LocalnetValidatorKeys" - if [ ! -d "${hmy_one_dir}/harmony-ops/" ]; then - git clone https://github.com/harmony-one/harmony-ops.git "${hmy_one_dir}/harmony-ops" - fi - if [ ! -d "${hmy_one_dir}/go-sdk/" ]; then - git clone https://github.com/harmony-one/go-sdk.git "${hmy_one_dir}/go-sdk" + source "$(go env GOPATH)/src/github.com/harmony-one/harmony/scripts/setup_bls_build_flags.sh" + hmy_gosdk="$(go env GOPATH)/src/github.com/harmony-one/go-sdk" + hmy_bin="${hmy_gosdk}/hmy" + hmy_ops="/tmp/harmony-ops" + keystore="${hmy_ops}/test-automation/api-tests/LocalnetValidatorKeys" + + rm -rf $hmy_ops + git clone https://github.com/harmony-one/harmony-ops.git $hmy_ops + + if [ ! -d "${hmy_gosdk}" ]; then + git clone https://github.com/harmony-one/go-sdk.git $hmy_gosdk fi if [ ! -f "${hmy_bin}" ]; then - make -C "${hmy_one_dir}/go-sdk/" + make -C $hmy_gosdk fi + + hmy_version=$($hmy_bin version 2>&1 >/dev/null) + if [[ "${hmy_version:32:3}" -lt "135" ]]; then + echo "Aborting staking tests since CLI version is out of date." + return + fi + python3 -m pip install pyhmy python3 -m pip install requests - python3 "${hmy_one_dir}/harmony-ops/test-automation/api-tests/test.py" --keystore ${keystore} \ - --cli_path ${hmy_bin} --test_dir "${hmy_one_dir}/harmony-ops/test-automation/api-tests/tests/" \ + python3 "${hmy_ops}/test-automation/api-tests/test.py" --keystore $keystore \ + --cli_path $hmy_bin --test_dir "${hmy_ops}/test-automation/api-tests/tests/" \ --rpc_endpoint_src="http://localhost:9500/" --rpc_endpoint_dst="http://localhost:9501/" --ignore_regression_test }