-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathregression-tests.sh
executable file
·120 lines (108 loc) · 3.37 KB
/
regression-tests.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/sh
set -e
tmp=/tmp
old_lavender=${CISOTOOLS_HOME}/bin/lavender
new_lavender=target/lavender
testhost=${HOME}/Projects/lavender/walter
artifact() {
if [ "$#" -ne 3 ] ; then
echo "usage: artifact <groupId> <artifactId> <version>"
exit 1
fi
groupId=$1
shift
artifactId=$1
shift
version=$1
shift
name=${artifactId}
echo "download ${groupId}:${artifactId}"
mvn -U dependency:copy "-Dartifact=${groupId}:${artifactId}:${version}:war" "-DoutputDirectory=${tmp}" >${tmp}/download.log 2>&1
file=${tmp}/${artifactId}-${version}.war
war ${name} ${file} ${file}
}
war() {
if [ "$#" -ne 3 ] ; then
echo "usage: war <name> <oldwar> <newwar>"
exit 1
fi
name=$1
shift
oldwar=$1
shift
newwar=$1
shift
dir=target/regression-tests/${name}
rm -rf ${dir}
mkdir -p ${dir}
echo
echo "testing ${name}"
echo
echo "* info old ..."
${new_lavender} info ${oldwar}
echo "* info new ..."
${new_lavender} info ${newwar}
echo "* old lavender ..."
${old_lavender} war ${oldwar} walter web test.idx >${dir}/old.log 2>&1
mv ${testhost}/web ${testhost}/${name}-old
echo "* new lavender ..."
${new_lavender} war ${newwar} walter web test.idx >${dir}/new.log 2>&1
mv ${testhost}/web ${testhost}/${name}-new
removeIndexComment ${testhost}/${name}-old/indexes
removeIndexComment ${testhost}/${name}-new/indexes
echo "* diff ..."
if diff -r --brief ${testhost}/${name}-old ${testhost}/${name}-new >${dir}/diff.log 2>&1 ; then
echo " ok: $?"
else
echo " failed: $?"
fi
}
removeIndexComment() {
if [ "$#" -ne 1 ] ; then
echo "usage: removeIndexComment <indexes>"
exit 1
fi
indexes=$1
find ${indexes} -type f -print0 | while IFS= read -r -d $'\0' file; do
echo "$(tail -n +2 ${file})" | sort > ${file}
done
}
shopArtifacts() {
artifact com.ionos.shop order-ca 3.2.18
artifact com.ionos.shop order-de 3.2.27
artifact com.ionos.shop order-es 3.2.20
artifact com.ionos.shop order-it 3.2.20
artifact com.ionos.shop order-us 3.2.26
artifact com.ionos.shop order-fr 3.2.24
artifact com.ionos.shop order-uk 3.2.26
artifact com.ionos.shop order-mx 3.2.16
artifact com.oneandone.sales ionos-eu 0.0.63
artifact com.ionos.shop cloud-de 2.0.13
artifact com.ionos.shop cloud-it 2.0.9
artifact com.ionos.shop cloud-ca 2.0.10
artifact com.ionos.shop cloud-fr 2.0.9
artifact com.ionos.shop cloud-mx 2.0.9
artifact com.ionos.shop cloud-uk 2.0.9
artifact com.ionos.shop cloud-us 2.0.9
artifact com.ionos.shop telesales-de 3.2.15
artifact com.ionos.shop telesales-es 3.2.12
artifact com.ionos.shop telesales-fr 3.2.9
artifact com.ionos.shop telesales-uk 3.2.12
artifact com.ionos.shop telesales-us 3.2.8
}
cpArtifacts() {
artifact com.ionos.shop upgrade-us 2.3.84
artifact com.ionos.shop upgrade-es 2.4.84
artifact com.ionos.shop upgrade-it 2.3.69
artifact com.ionos.shop upgrade-fr 3.2.85
artifact com.ionos.shop upgrade-uk 2.4.87
artifact com.ionos.shop upgrade-de 2.6.91
artifact com.ionos.shop upgrade-ca 2.4.69
artifact com.ionos.shop upgrade-mx 2.3.66
}
echo "testing $(${old_lavender} version) vs $(${new_lavender} version)"
rm -rf ${testhost}
# artifact com.oneandone.sales ionos-eu 0.0.63
root=/Users/mhm/Projects/github.com/net/oneandone/lavender-test/shops
war ionos-eu ${root}/ionos-eu-orig/target/ionos-eu-0.0.64-SNAPSHOT.war ${root}/ionos-eu/target/ionos-eu-0.0.64-SNAPSHOT.war
shopArtifacts