From 7e99ae88fe17396582f7980968705d27a07093ce Mon Sep 17 00:00:00 2001 From: Martin Rupp Date: Tue, 20 Jul 2021 14:14:50 +0200 Subject: [PATCH] fix3 --- pipelines/upgrade-testing/check_upgrade.sh | 40 +++++++++++------- .../upgrade-testing/check_upgrade_fast.sh | 42 +++++++++++++++++++ .../upgrade-testing/create_upgrade_targz.sh | 1 + 3 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 pipelines/upgrade-testing/check_upgrade_fast.sh diff --git a/pipelines/upgrade-testing/check_upgrade.sh b/pipelines/upgrade-testing/check_upgrade.sh index 33fcf25b7a7..cf6bb89b8b0 100644 --- a/pipelines/upgrade-testing/check_upgrade.sh +++ b/pipelines/upgrade-testing/check_upgrade.sh @@ -1,24 +1,36 @@ #!/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 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