Revert "Disable elasticsearch tests in Gerrit-CI builds"

This reverts commit 6103b5ae0c7293f32c69be574de1d51061f53a64.

Now that these tests are meant to pass again based on [1]'s fix. Keep
excluding the elastic tests though for EOL branches [2] -in [3]. The
reverted commit only disabled the elastic tests for the stable-2.16
branch, explicitly that is.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/287983
[2] https://gerrit-review.googlesource.com/c/gerrit-ci-scripts/+/270340
[3] jenkins/gerrit-bazel-verifier-test.sh

Change-Id: Ic0b3c5598843f978ef4589df3586e843bc470f08
diff --git a/jenkins/gerrit-bazel-build-plugin-branch.sh b/jenkins/gerrit-bazel-build-plugin-branch.sh
index cc18837..355d075 100644
--- a/jenkins/gerrit-bazel-build-plugin-branch.sh
+++ b/jenkins/gerrit-bazel-build-plugin-branch.sh
@@ -31,18 +31,12 @@
 bazelisk version
 bazelisk build $BAZEL_OPTS --spawn_strategy=standalone --genrule_strategy=standalone $TARGETS
 
-TEST_TAG_FILTERS="-flaky"
-if [ "{branch}" == "stable-2.16" ]
-then
-  TEST_TAG_FILTERS="$TEST_TAG_FILTERS,-elastic"
-fi
-
 BAZEL_OPTS="$BAZEL_OPTS --spawn_strategy=standalone --genrule_strategy=standalone \
                    --test_output errors \
                    --test_summary detailed --flaky_test_attempts 3 \
                    --test_verbose_timeout_warnings --build_tests_only \
                    --test_timeout 3600 \
-                   --test_tag_filters=$TEST_TAG_FILTERS \
+                   --test_tag_filters=-flaky \
                    --test_env DOCKER_HOST=$DOCKER_HOST"
 bazelisk test $BAZEL_OPTS //tools/bzl:always_pass_test plugins/{name}/...
 
diff --git a/jenkins/gerrit-bazel-test.sh b/jenkins/gerrit-bazel-test.sh
index 897228d..78bc9cd 100755
--- a/jenkins/gerrit-bazel-test.sh
+++ b/jenkins/gerrit-bazel-test.sh
@@ -9,18 +9,12 @@
   export BAZEL_OPTS=""
 fi
 
-TEST_TAG_FILTERS="-flaky"
-if [ "{branch}" == "stable-2.16" ]
-then
-  TEST_TAG_FILTERS="$TEST_TAG_FILTERS,-elastic"
-fi
-
 export BAZEL_OPTS="$BAZEL_OPTS --spawn_strategy=standalone --genrule_strategy=standalone \
                    --test_output errors \
                    --test_summary detailed --flaky_test_attempts 3 \
                    --test_verbose_timeout_warnings --build_tests_only \
                    --test_timeout 3600 \
-                   --test_tag_filters=$TEST_TAG_FILTERS \
+                   --test_tag_filters=-flaky \
                    --test_env DOCKER_HOST=$DOCKER_HOST"
 export WCT_HEADLESS_MODE=1
 
diff --git a/jenkins/gerrit-bazel-verifier-test.sh b/jenkins/gerrit-bazel-verifier-test.sh
index 7e519bd..c4c4965 100755
--- a/jenkins/gerrit-bazel-verifier-test.sh
+++ b/jenkins/gerrit-bazel-verifier-test.sh
@@ -7,18 +7,20 @@
 echo "Test with mode=$MODE"
 echo '----------------------------------------------'
 
-TEST_TAG_FILTERS="-flaky"
-if [ "$TARGET_BRANCH" == "stable-2.16" ]
-then
-  TEST_TAG_FILTERS="$TEST_TAG_FILTERS,-elastic"
-fi
+case $TARGET_BRANCH in
+  stable-2.*)
+    TEST_TAG_FILTER="-flaky,-elastic"
+    ;;
+  *)
+    TEST_TAG_FILTER="-flaky"
+esac
 
 export BAZEL_OPTS="$BAZEL_OPTS --spawn_strategy=standalone --genrule_strategy=standalone \
                  --test_output errors \
                  --test_summary detailed --flaky_test_attempts 3 \
                  --test_verbose_timeout_warnings --build_tests_only \
                  --test_timeout 3600 \
-                 --test_tag_filters=$TEST_TAG_FILTERS \
+                 --test_tag_filters=$TEST_TAG_FILTER \
                  --test_env DOCKER_HOST=$DOCKER_HOST"
 export WCT_HEADLESS_MODE=1