ceremonyclient/pebble/scripts/run-crossversion-meta.sh
Cassandra Heart 2e2a1e4789
v1.2.0 (#31)
2024-01-03 01:31:42 -06:00

47 lines
1.2 KiB
Bash
Executable File

#!/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