blob: 53db60d468fc8d8c4a324308360a018d3402cec6 [file] [log] [blame]
#!/bin/bash -ex
. set-java.sh 8
cd gerrit
echo "Test with mode=$MODE"
echo '----------------------------------------------'
case $TARGET_BRANCH$MODE in
masterrbe)
TEST_TAG_FILTER="-flaky,-elastic,-git-protocol-v2"
BAZEL_OPTS="--config=remote --remote_instance_name=projects/api-project-164060093628/instances/default_instance"
;;
masternotedb)
TEST_TAG_FILTER="-flaky,elastic,git-protocol-v2"
;;
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" == *"reviewdb"* ]]
then
GERRIT_NOTEDB="--test_env=GERRIT_NOTEDB=OFF"
bazelisk test $GERRIT_NOTEDB $BAZEL_OPTS //...
fi
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...'
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