Skip to content

Commit 212ce45

Browse files
committed
address review
1 parent fce3f9e commit 212ce45

File tree

4 files changed

+68
-95
lines changed

4 files changed

+68
-95
lines changed
Lines changed: 64 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,68 @@
11
#!/bin/bash
2-
32
UPGRADE_URL=s3://splice-snapshots/upgrade_tests
43

5-
VERSION=${1} # e.g. 3.1.0.1971
6-
shift 1
7-
8-
PREVIOUS_BRANCH=`git rev-parse --abbrev-ref HEAD`
9-
git stash
10-
11-
# creates a file platform_it_${VERSION}.tar.gz
12-
git checkout tags/${VERSION}
13-
cd platform_it
14-
rm -rf target *.log snappy*.jnilib
15-
cd ..
16-
17-
./start-splice-cluster $*
18-
./start-splice-cluster -k
19-
20-
rm -rf upgrade_test_TMP
21-
mkdir -p upgrade_test_TMP/platform_it/target
22-
cd upgrade_test_TMP
23-
cp -r ../platform_it/target/hbase platform_it/target/.
24-
cp -r ../platform_it/target/zookeeper platform_it/target/.
25-
tar -czvf ../platform_it_${VERSION}.tar.gz platform_it
26-
cd ..
27-
rm -rf upgrade_test_TMP
28-
29-
git checkout ${PREVIOUS_BRANCH}
30-
git stash pop
31-
32-
# restart on that version
33-
./start-splice-cluster $*
34-
35-
# clean up platform_it
36-
cd platform_it
37-
git clean -dfx
38-
cd ..
39-
40-
# download the previous standalone data
41-
tar -xzvf platform_it_${VERSION}.tar.gz
42-
rm platform_it_${VERSION}.tar.gz
43-
44-
# restart cluster
45-
./start-splice-cluster -l $*
46-
47-
# test
48-
if mvn -B -e surefire:test -Pcore,cdh6.3.0 -Dtest='UpgradeTestIT#*' -DskipServerStart -DfailIfNoTests=false; then
49-
echo "UPGRADE SUCCEEDED"
50-
cat platform_it/splice.log | grep 'upgrade scripts'
51-
cat platform_it/splice.log | grep 'Running upgrade script'
52-
else
53-
echo "!!! UPGRADE FAILED !!!"
4+
if [ $# -lt 2 ]
5+
then
6+
echo "usage: bash check_upgrade.sh {VERSION} {additional start-splice-cluster parameters}"
7+
echo "------------------------------------------------------------------------------------------"
8+
echo "uses a previously created tar.gz to test upgrade"
9+
echo "e.g. bash check_upgrade.sh 3.2.2021"
10+
11+
exit 1
5412
fi
13+
14+
function test_upgrade
15+
{
16+
OLDVERSION=$1
17+
echo ""
18+
echo " testing $OLDVERSION upgrade"
19+
echo "--------------------------------------------------------------------------------"
20+
echo ""
21+
22+
UPGRADE_URL=s3://splice-snapshots/upgrade_tests
23+
24+
# stop current cluster
25+
./start-splice-cluster -k
26+
27+
# clean up platform_it
28+
cd platform_it
29+
git clean -dfx
30+
cd ..
31+
32+
echo ""
33+
echo " download ${UPGRADE_URL}/platform_it_${OLDVERSION}.tar.gz"
34+
echo "--------------------------------------------------------------------------------"
35+
echo ""
36+
# download the previous standalone data
37+
aws s3 cp ${UPGRADE_URL}/platform_it_${OLDVERSION}.tar.gz .
38+
tar -xzf platform_it_${OLDVERSION}.tar.gz
39+
rm platform_it_${OLDVERSION}.tar.gz
40+
41+
echo ""
42+
echo " ./start-splice-cluster -l $*"
43+
echo "--------------------------------------------------------------------------------"
44+
echo ""
45+
46+
# restart cluster
47+
./start-splice-cluster -l $*
48+
49+
# test
50+
if mvn -B -e surefire:test -Pcore,cdh6.3.0 \
51+
-Dtest='UpgradeTestIT#*' -DskipServerStart \
52+
-DfailIfNoTests=false; \
53+
-Dmaven.test.redirectTestOutputToFile=true
54+
then
55+
echo "UPGRADE SUCCEEDED"
56+
cat platform_it/splice.log | grep 'upgrade scripts'
57+
cat platform_it/splice.log | grep 'Running upgrade script'
58+
else
59+
echo "!!! UPGRADE FAILED !!!"
60+
exit 2
61+
fi
62+
63+
echo "--------------------------------------------------------------------------------"
64+
echo ""
65+
}
66+
67+
68+
test_upgrade $*

pipelines/upgrade-testing/check_upgrade_fast.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

pipelines/upgrade-testing/create_upgrade_targz.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ UPGRADE_URL=s3://splice-snapshots/upgrade_tests
55

66
if [ $# -lt 2 ]
77
then
8-
echo "usage: bash platform_it/src/test/bin/create_upgrade_targz.sh {VERSION} {test/upload} {additional start-splice-cluster parameters}"
8+
echo "usage: bash pipelines/upgrade-testing/create_upgrade_targz.sh {VERSION} {test/upload} {additional start-splice-cluster parameters}"
99
echo "----------------------------------------------------------------------------------------------------------------------------------"
1010
echo "creates a tar.gz of a spliceengine standalone cluster that can be used to test upgrade"
11-
echo "e.g. bash create_upgrade_targz.sh 3.1.0.1971 test -T 16 -pcore,cdh6.3.0"
11+
echo "e.g. bash create_upgrade_targz.sh 3.1.0.1971 test -pcore,cdh6.3.0"
1212
exit 1
1313
fi
1414

1515
VERSION=${1} # e.g. 3.1.0.1971
1616
MODE=${2} # test or upload
1717
shift 2
1818

19-
2019
PREVIOUS_BRANCH=`git rev-parse --abbrev-ref HEAD`
2120
git stash
2221

pipelines/upgrade-testing/jenkins.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# JENKINS FILE USED FOR UPGRADE-TESTING
2+
13
#!/bin/bash
24

35
export platform=${ghprbCommentBody##*@}

0 commit comments

Comments
 (0)