diff options
author | Marco Miller <marco.miller@ericsson.com> | 2018-07-06 14:57:38 -0400 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2018-07-11 15:29:10 +0900 |
commit | ea072f29620208cbcf082cfdbb97b1522f10c56e (patch) | |
tree | 0e9c4dde5966760268d6e64c8859cdba4d6f656d | |
parent | 5658c9586907bec0bb5fe4106934fa02e25bceaf (diff) |
Elasticsearch: cover V5 and flaky V6 tests -for CI
Add execution of the V5 and V6 tests to the already included V2 default.
Include flaky tag support for the V6 tests though, as their accounts and
groups subset currently fails (cf. Issue 9252). Adding such a tag here
allows to exclude the V6 tests in a CI context. The V5 tests still pass
(just like V2's) thus require no such flaky tag for passing CI coverage.
Before this change, it was not possible to benefit from V5/V6 elastic
tests feedback. Thus the previous risk of elastic support regressions.
Once a fix for Issue 9252 becomes available, one will be able to get
such feedback for V6, on top of V5 added herein and default V2. Until
then, excluding the hereby flaky V6 tests allows for V5 and V2 checks:
bazel test //... --test_tag_filters=elastic,-flaky (e.g.).
Change-Id: I62fef6dca20a73065df6b3dd4b21deb1ac7653fd
-rw-r--r-- | gerrit-elasticsearch/BUILD | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/gerrit-elasticsearch/BUILD b/gerrit-elasticsearch/BUILD index e39c3ac698..eeed72fd18 100644 --- a/gerrit-elasticsearch/BUILD +++ b/gerrit-elasticsearch/BUILD @@ -45,27 +45,61 @@ java_library( ], ) +ELASTICSEARCH_DEPS = [ + ":elasticsearch", + ":elasticsearch_test_utils", + "//gerrit-server:query_tests_code", + "//gerrit-server:testutil", + "//lib:truth", + "//lib/guice", + "//lib/jgit/org.eclipse.jgit:jgit", +] + +TYPES = [ + "account", + "change", + "group", +] + +SUFFIX = "sTest.java" + ELASTICSEARCH_TESTS = {i: "src/test/java/com/google/gerrit/elasticsearch/ElasticQuery" + i.capitalize() + "sTest.java" for i in [ "account", "change", "group", ]} +ELASTICSEARCH_TESTS = {i: "src/test/java/com/google/gerrit/elasticsearch/ElasticQuery" + i.capitalize() + SUFFIX for i in TYPES} + +ELASTICSEARCH_TESTS_V5 = {i: "src/test/java/com/google/gerrit/elasticsearch/ElasticV5Query" + i.capitalize() + SUFFIX for i in TYPES} + +ELASTICSEARCH_TESTS_V6 = {i: "src/test/java/com/google/gerrit/elasticsearch/ElasticV6Query" + i.capitalize() + SUFFIX for i in TYPES} + +ELASTICSEARCH_TAGS = [ + "docker", + "elastic", +] + [junit_tests( name = "elasticsearch_query_%ss_test" % name, size = "large", srcs = [src], - tags = [ - "docker", - "elastic", - ], - deps = [ - ":elasticsearch", - ":elasticsearch_test_utils", - "//gerrit-server:query_tests_code", - "//gerrit-server:testutil", - "//lib:truth", - "//lib/guice", - "//lib/jgit/org.eclipse.jgit:jgit", - ], + tags = ELASTICSEARCH_TAGS, + deps = ELASTICSEARCH_DEPS, ) for name, src in ELASTICSEARCH_TESTS.items()] + +[junit_tests( + name = "elasticsearch_query_%ss_test_v5" % name, + size = "large", + srcs = [src], + tags = ELASTICSEARCH_TAGS, + deps = ELASTICSEARCH_DEPS, +) for name, src in ELASTICSEARCH_TESTS_V5.items()] + +[junit_tests( + name = "elasticsearch_query_%ss_test_v6" % name, + size = "large", + srcs = [src], + tags = ELASTICSEARCH_TAGS, + deps = ELASTICSEARCH_DEPS, +) for name, src in ELASTICSEARCH_TESTS_V6.items()] |