scripts/tests/testversions: fix race in install_sim

Change-Id: I0792686d99a222d5977fd913425e2b94d100c40e
This commit is contained in:
Yingrong Zhao 2020-12-03 19:43:16 -05:00 committed by Yingrong Zhao
parent c1bdb88d3c
commit 0faf7d5293

View File

@ -93,11 +93,9 @@ install_sim(){
go build -race -v -o ${bin_dir}/gateway storj.io/storj/cmd/gateway >/dev/null 2>&1
popd
else
rm -rf .build/gateway-tmp
mkdir -p .build/gateway-tmp
pushd .build/gateway-tmp
go mod init gatewaybuild && GOBIN=${bin_dir} GO111MODULE=on go get storj.io/gateway@latest
popd
mkdir -p ${work_dir}/build/gateway-tmp
(cd ${work_dir}/build/gateway-tmp && go mod init gatewaybuild && GOBIN=${bin_dir} GO111MODULE=on go get storj.io/gateway@latest;)
rm -rf ${work_dir}/build/gateway-tmp
fi
}
@ -114,14 +112,12 @@ setup_stage(){
PATH=$src_sat_version_dir/bin:$PATH src_sat_cfg_dir=$(storj-sim network env --config-dir=${src_sat_version_dir}/local-network/ SATELLITE_0_DIR)
PATH=$test_dir/bin:$PATH dest_sat_cfg_dir=$(storj-sim network env --config-dir=${test_dir}/local-network/ SATELLITE_0_DIR)
# ln binary and copy config.yaml for desired version
# ln binary and copy config.yaml for desired version
ln -f $(version_dir ${sat_version})/bin/storj-sim $test_dir/bin/storj-sim
ln -f $src_sat_version_dir/bin/satellite $dest_sat_cfg_dir/satellite
cp $src_sat_cfg_dir/config.yaml $dest_sat_cfg_dir
replace_in_file "${src_sat_version_dir}" "${test_dir}" "${dest_sat_cfg_dir}/config.yaml"
counter=0
for sn_version in ${stage_sn_versions}; do
local src_sn_version_dir=$(version_dir ${sn_version})
@ -173,7 +169,7 @@ write_exit_status(){
local exit_status=$?
local version=$1
echo $exit_status > ${exit_statuses_dir}/${version} # write exit code to a file named with the current installing version
echo "installation for ${version} exited"
echo "installation for ${version} exited with status $exit_status"
}
# clean up git worktree
git worktree prune