forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-crossversion-meta.sh
executable file
·46 lines (37 loc) · 1.18 KB
/
run-crossversion-meta.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
#!/bin/bash
set -ex
BRANCH=$(git symbolic-ref --short HEAD)
TEMPDIR=(`mktemp -d -t crossversion-$(date +%Y-%m-%d-%H-%M-%S)-XXXXXXXXXX`)
VERSIONS=""
for branch in "$@"
do
git checkout "$branch"
sha=`git rev-parse --short HEAD`
# If the branch name has a "-<suffix>", pull off the suffix. With the
# crl-release-{XX.X} release branch naming scheme, this will extract the
# {XX.X}.
version=`cut -d- -f3 <<< "$branch"`
echo "Building $version ($sha)"
go test -c -o "$TEMPDIR/meta.$version.test" ./internal/metamorphic
VERSIONS="$VERSIONS -version $version,$sha,$TEMPDIR/meta.$version.test"
done
# Return to whence we came.
git checkout $BRANCH
if [[ -z "${STRESS}" ]]; then
go test ./internal/metamorphic/crossversion \
-test.v \
-test.timeout "${TIMEOUT:-30m}" \
-test.run 'TestMetaCrossVersion$' \
-seed ${SEED:-0} \
-factor ${FACTOR:-10} \
$(echo $VERSIONS)
else
stress -p 1 go test ./internal/metamorphic/crossversion \
-test.v \
-test.timeout "${TIMEOUT:-30m}" \
-test.run 'TestMetaCrossVersion$' \
-seed ${SEED:-0} \
-factor ${FACTOR:-10} \
$(echo $VERSIONS)
fi
rm -rf $TEMPDIR