scripts/tests/rollingupgrade: test current release version on master

branch

Currently, we are testing previous release version upgrading to latest
master on each master build
However, this behavior is only desired when the test is running on a
release branch.

Change-Id: Iaeb66f44951c9e4934ca3c8316d1e490d7958239
This commit is contained in:
Yingrong Zhao 2020-10-21 13:29:52 -04:00
parent d6b9563e56
commit 746cbfc659
2 changed files with 16 additions and 10 deletions

2
Jenkinsfile vendored
View File

@ -67,7 +67,7 @@ node('node') {
sh 'docker exec postgres-$BUILD_NUMBER createdb -U postgres teststorj' sh 'docker exec postgres-$BUILD_NUMBER createdb -U postgres teststorj'
// fetch the remote master branch // fetch the remote master branch
sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/master:refs/remotes/origin/master' sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/master:refs/remotes/origin/master'
sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres -e CC=gcc storjlabs/golang:1.15.2' sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh -e BRANCH_NAME -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres -e CC=gcc storjlabs/golang:1.15.2'
} }
catch(err){ catch(err){
throw err throw err

View File

@ -47,16 +47,23 @@ populate_sno_versions(){
# set peers' versions # set peers' versions
# in stage 1: satellite, uplink, and storagenode use latest release version # in stage 1: satellite, uplink, and storagenode use latest release version
# in stage 2: satellite core uses latest release version and satellite api uses master. Storage nodes are split into half on latest release version and half on master. Uplink uses the latest release version plus master # in stage 2: satellite core uses latest release version and satellite api uses master. Storage nodes are split into half on latest release version and half on master. Uplink uses the latest release version plus master
BRANCH_NAME=${BRANCH_NAME:-""}
git fetch --tags git fetch --tags
# if it's running on a release branch, we will set the stage 1 version to be the latest previous major release
# if it's running on master, we will set the stage 1 version to be the current release version
current_commit=$(git rev-parse HEAD) current_commit=$(git rev-parse HEAD)
current_release_version=$(git describe --tags $current_commit | cut -d '.' -f 1-2) stage1_release_version=$(git tag -l --sort -version:refname | grep -v rc | head -1)
previous_release_version=$(git describe --tags `git rev-list --exclude='*rc*' --exclude=$current_release_version* --tags --max-count=1`) if [[ $BRANCH_NAME = v* ]]; then
stage1_sat_version=$previous_release_version current_major_release_version=$(git describe --tags $current_commit | cut -d '.' -f 1-2)
stage1_uplink_version=$previous_release_version previous_release_version=$(git describe --tags `git rev-list --exclude='*rc*' --exclude=$current_major_release_version* --tags --max-count=1`)
stage1_storagenode_versions=$(populate_sno_versions $previous_release_version 10) stage1_release_version=$previous_release_version
fi
stage1_sat_version=$stage1_release_version
stage1_uplink_version=$stage1_release_version
stage1_storagenode_versions=$(populate_sno_versions $stage1_release_version 10)
stage2_sat_version=$current_commit stage2_sat_version=$current_commit
stage2_uplink_versions=$previous_release_version\ $current_commit stage2_uplink_versions=$stage1_release_version\ $current_commit
stage2_storagenode_versions=$(populate_sno_versions $previous_release_version 5)\ $(populate_sno_versions $current_commit 5) stage2_storagenode_versions=$(populate_sno_versions $stage1_release_version 5)\ $(populate_sno_versions $current_commit 5)
echo "stage1_sat_version" $stage1_sat_version echo "stage1_sat_version" $stage1_sat_version
echo "stage1_uplink_version" $stage1_uplink_version echo "stage1_uplink_version" $stage1_uplink_version
@ -201,7 +208,6 @@ for version in ${unique_versions}; do
echo -e "\nAdding worktree for ${version} in ${dir}." echo -e "\nAdding worktree for ${version} in ${dir}."
git worktree add -f "$dir" "${version}" git worktree add -f "$dir" "${version}"
rm -f ${dir}/private/version/release.go
rm -f ${dir}/internal/version/release.go rm -f ${dir}/internal/version/release.go
# clear out release information # clear out release information
cat > ${dir}/private/version/release.go <<-EOF cat > ${dir}/private/version/release.go <<-EOF
@ -210,7 +216,7 @@ for version in ${unique_versions}; do
package version package version
EOF EOF
if [[ $version = $previous_release_version || $version = $current_commit ]] if [[ $version = $stage1_release_version || $version = $current_commit ]]
then then
echo "Installing storj-sim for ${version} in ${dir}." echo "Installing storj-sim for ${version} in ${dir}."
pushd ${dir} pushd ${dir}