-
Notifications
You must be signed in to change notification settings - Fork 12
/
run-upgrade-test.sh
executable file
·61 lines (55 loc) · 1.72 KB
/
run-upgrade-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
export MAVEN_OPTS="-Xms521M -Xmx1024M"
if [[ "$3" == "" ]] ; then
echo "Missing argument: correct usage <./run-upgrade-test.sh oldVersion newVersion database>"
else
mvn -T 1C clean install -DskipTests
OLD_VERSION_MODULE="flowable-upgrade-$1"
echo "Old version module: $OLD_VERSION_MODULE"
NEW_VERSION_MODULE="flowable-upgrade-$2"
echo "New version module: $NEW_VERSION_MODULE"
DATABASE=$3
echo "Database type: $DATABASE"
cd flowable-upgrade-drop
if [[ "$DATABASE" == "oracle" ]] ; then
mvn -Ddatabasewithschema=$DATABASE -Duser.timezone=GMT clean test
else
mvn -Ddatabase=$DATABASE clean test
fi
echo
echo "Running old version module: generating data for version $1"
echo
cd ..
cd $OLD_VERSION_MODULE
if [[ "$DATABASE" == "oracle" ]] ; then
mvn -Ddatabasewithschema=$DATABASE -Duser.timezone=GMT -DoldVersion=$1 -Dmaven.test.skip=true -DgenerateData=true clean test
else
mvn -Ddatabase=$DATABASE -DoldVersion=$1 -Dmaven.test.skip=true -DgenerateData=true clean test
fi
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo
echo "Running new version module: running $2 unit tests against $1 data"
echo
cd ..
cd $NEW_VERSION_MODULE
if [[ "$DATABASE" == "oracle" ]] ; then
mvn -Ddatabasewithschema=$DATABASE -Duser.timezone=GMT -DoldVersion=$1 clean test
else
mvn -Ddatabase=$DATABASE -DoldVersion=$1 clean test
fi
else
echo
echo
echo "Build failure on old version module. Halting."
echo
fi
cd ..
cd flowable-upgrade-drop
if [[ "$DATABASE" == "oracle" ]] ; then
mvn -Ddatabasewithschema=$DATABASE -Duser.timezone=GMT clean test
else
mvn -Ddatabase=$DATABASE clean test
fi
fi