| echo "Test with mode=$MODE" |
| echo '----------------------------------------------' |
| export BAZEL_OPTS="--spawn_strategy=standalone --genrule_strategy=standalone \ |
| --test_summary detailed --flaky_test_attempts 3 \ |
| --test_verbose_timeout_warnings --build_tests_only \ |
| --test_tag_filters=-flaky,-docker \ |
| --test_env DOCKER_HOST=$DOCKER_HOST" |
| if [[ "$MODE" == *"reviewdb"* ]] |
| GERRIT_NOTEDB="--test_env=GERRIT_NOTEDB=OFF" |
| bazel test $BAZEL_OPTS //... |
| if [[ "$MODE" == *"notedb"* ]] |
| GERRIT_NOTEDB="--test_env=GERRIT_NOTEDB=ON" |
| bazel test $GERRIT_NOTEDB $BAZEL_OPTS //... |
| if [[ "$TARGET_BRANCH" == "master" || "$TARGET_BRANCH" == "stable-3.0" || "$TARGET_BRANCH" == "stable-2.16" || "$TARGET_BRANCH" == "stable-2.15" || "$TARGET_BRANCH" == "stable-2.14" ]] |
| if [[ "$MODE" == *"polygerrit"* ]] |
| echo 'Not running local tests because env var "DISPLAY" is not set.' |
| echo 'Running local tests...' |
| bash ./polygerrit-ui/app/run_test.sh || touch ~/polygerrit-failed |
| if [ -z "$SAUCE_USERNAME" ] || [ -z "$SAUCE_ACCESS_KEY" ] |
| echo 'Not running on Sauce Labs because env vars are not set.' |
| echo 'Running tests on Sauce Labs...' |
| WCT_ARGS='--plugin sauce' bash ./polygerrit-ui/app/run_test.sh || touch ~/polygerrit-failed |