blob: 47fe4dab3097b4e281f258a358dcd62e18e358ad [file] [log] [blame]
#!/bin/bash -ex
case "$TARGET_BRANCH" in
stable-3.3|stable-3.4)
. set-java.sh 8
;;
*)
. set-java.sh 11
;;
esac
cd gerrit
echo "Test with mode=$MODE"
echo '----------------------------------------------'
case $TARGET_BRANCH$MODE in
masterrbe|stable-3.4rbe|stable-3.5rbe|stable-3.6rbe)
TEST_TAG_FILTER="-flaky,-elastic,-no_rbe"
BAZEL_OPTS="--config=remote --remote_instance_name=projects/api-project-164060093628/instances/default_instance"
;;
masternotedb|stable-3.4notedb|stable-3.5notedb|stable-3.6notedb)
TEST_TAG_FILTER="-flaky,elastic,no_rbe"
;;
stable-2.*)
TEST_TAG_FILTER="-flaky,-elastic"
;;
*)
TEST_TAG_FILTER="-flaky"
esac
export BAZEL_OPTS="$BAZEL_OPTS \
--flaky_test_attempts 3 \
--test_timeout 3600 \
--test_tag_filters=$TEST_TAG_FILTER \
--test_env DOCKER_HOST=$DOCKER_HOST"
export WCT_HEADLESS_MODE=1
java -fullversion
bazelisk version
if [[ "$MODE" == *"notedb"* ]]
then
GERRIT_NOTEDB="--test_env=GERRIT_NOTEDB=ON"
bazelisk test $GERRIT_NOTEDB $BAZEL_OPTS //...
fi
if [[ "$MODE" == *"rbe"* ]]
then
bazelisk test $BAZEL_OPTS //...
fi
if [[ "$MODE" == *"polygerrit"* ]]
then
echo 'Running Documentation tests...'
bazelisk test $BAZEL_OPTS //tools/bzl:always_pass_test Documentation/...
echo "Running local tests in $(google-chrome --version)"
bash ./polygerrit-ui/app/run_test.sh || touch ~/polygerrit-failed
if [ -z "$SAUCE_USERNAME" ] || [ -z "$SAUCE_ACCESS_KEY" ]
then
echo 'Not running on Sauce Labs because env vars are not set.'
else
echo 'Running tests on Sauce Labs...'
WCT_ARGS='--plugin sauce' bash ./polygerrit-ui/app/run_test.sh || touch ~/polygerrit-failed
fi
fi