diff --git a/pipelines/upgrade-testing/check_upgrade.sh b/pipelines/upgrade-testing/check_upgrade.sh index 33fcf25b7a7..85836089d33 100644 --- a/pipelines/upgrade-testing/check_upgrade.sh +++ b/pipelines/upgrade-testing/check_upgrade.sh @@ -1,31 +1,42 @@ #!/bin/bash + UPGRADE_URL=s3://splice-snapshots/upgrade_tests -if [ $# -lt 2 ] -then - echo "usage: bash create_upgrade_targz.sh {VERSION} {additional start-splice-cluster parameters}" - echo "------------------------------------------------------------------------------------------" - echo "uses a previously created tar.gz to test upgrade" - echo "e.g. bash create_upgrade_targz.sh 3.2.2021 -T 16" - echo "make sure you current branch has already been build" - echo "don't use -b, since we are deleting some files in platform_it/target" - - exit 1 -fi +VERSION=${1} # e.g. 3.1.0.1971 +shift 1 + +PREVIOUS_BRANCH=`git rev-parse --abbrev-ref HEAD` -VERSION=${1} -shift +# creates a file platform_it_${VERSION}.tar.gz +git checkout tags/${VERSION} +cd platform_it +rm -rf target *.log snappy*.jnilib +cd .. -# stop current cluster +./start-splice-cluster $* ./start-splice-cluster -k +rm -rf upgrade_test_TMP +mkdir -p upgrade_test_TMP/platform_it/target +cd upgrade_test_TMP +cp -r ../platform_it/target/hbase platform_it/target/. +cp -r ../platform_it/target/zookeeper platform_it/target/. +tar -czvf ../platform_it_${VERSION}.tar.gz platform_it +cd .. +rm -rf upgrade_test_TMP + +git checkout ${PREVIOUS_BRANCH} + + +# restart on that version +./start-splice-cluster $* + # clean up platform_it cd platform_it git clean -dfx cd .. # download the previous standalone data -aws s3 cp ${UPGRADE_URL}/platform_it_${VERSION}.tar.gz . tar -xzvf platform_it_${VERSION}.tar.gz rm platform_it_${VERSION}.tar.gz diff --git a/pipelines/upgrade-testing/check_upgrade_fast.sh b/pipelines/upgrade-testing/check_upgrade_fast.sh new file mode 100644 index 00000000000..33fcf25b7a7 --- /dev/null +++ b/pipelines/upgrade-testing/check_upgrade_fast.sh @@ -0,0 +1,42 @@ +#!/bin/bash +UPGRADE_URL=s3://splice-snapshots/upgrade_tests + +if [ $# -lt 2 ] +then + echo "usage: bash create_upgrade_targz.sh {VERSION} {additional start-splice-cluster parameters}" + echo "------------------------------------------------------------------------------------------" + echo "uses a previously created tar.gz to test upgrade" + echo "e.g. bash create_upgrade_targz.sh 3.2.2021 -T 16" + echo "make sure you current branch has already been build" + echo "don't use -b, since we are deleting some files in platform_it/target" + + exit 1 +fi + +VERSION=${1} +shift + +# stop current cluster +./start-splice-cluster -k + +# clean up platform_it +cd platform_it +git clean -dfx +cd .. + +# download the previous standalone data +aws s3 cp ${UPGRADE_URL}/platform_it_${VERSION}.tar.gz . +tar -xzvf platform_it_${VERSION}.tar.gz +rm platform_it_${VERSION}.tar.gz + +# restart cluster +./start-splice-cluster -l $* + +# test +if mvn -B -e surefire:test -Pcore,cdh6.3.0 -Dtest='UpgradeTestIT#*' -DskipServerStart -DfailIfNoTests=false; then + echo "UPGRADE SUCCEEDED" + cat platform_it/splice.log | grep 'upgrade scripts' + cat platform_it/splice.log | grep 'Running upgrade script' +else + echo "!!! UPGRADE FAILED !!!" +fi diff --git a/pipelines/upgrade-testing/create_upgrade_targz.sh b/pipelines/upgrade-testing/create_upgrade_targz.sh index d51f4469fa8..15567529d73 100644 --- a/pipelines/upgrade-testing/create_upgrade_targz.sh +++ b/pipelines/upgrade-testing/create_upgrade_targz.sh @@ -27,6 +27,7 @@ rm -rf target *.log snappy*.jnilib cd .. ./start-splice-cluster $* +./start-splice-cluster -k rm -rf upgrade_test_TMP mkdir -p upgrade_test_TMP/platform_it/target