From 1cc0f185796ce2f9841e1a4757d66742bed2a398 Mon Sep 17 00:00:00 2001 From: mbhave Date: Tue, 31 Mar 2020 08:21:26 +0100 Subject: [PATCH 1/4] Search-2142: Fixed the solr api tests to work based on the Sharding Method --- e2e-test/pom.xml | 2 +- .../java/org/alfresco/search/TestGroup.java | 12 ++-- .../functional/AbstractE2EFunctionalTest.java | 44 ++++++++++++ .../search/ExplicitRoutingTest.java | 2 +- .../searchServices/search/ShardInfoTest.java | 6 +- .../tracker/CascadingIntegrationTest.java | 2 +- .../solr/admin/SolrE2eAdminTest.java | 68 +++++++------------ 7 files changed, 81 insertions(+), 55 deletions(-) diff --git a/e2e-test/pom.xml b/e2e-test/pom.xml index 27ea7c0e0..32fd96ea3 100644 --- a/e2e-test/pom.xml +++ b/e2e-test/pom.xml @@ -11,7 +11,7 @@ Search Analytics E2E Tests Test Project to test Search Service and Analytics Features on a complete setup of Alfresco, Share - 1.35 + 1.36 1.13 3.0.20 3.3.0.1 diff --git a/e2e-test/src/main/java/org/alfresco/search/TestGroup.java b/e2e-test/src/main/java/org/alfresco/search/TestGroup.java index 4ecec0d57..49a0bb8c2 100644 --- a/e2e-test/src/main/java/org/alfresco/search/TestGroup.java +++ b/e2e-test/src/main/java/org/alfresco/search/TestGroup.java @@ -27,14 +27,12 @@ public class TestGroup public static final String PREUPGRADE = "pre-upgrade"; public static final String POSTUPGRADE = "post-upgrade"; - public static final String ASS_MASTER_SLAVE = "ASS_Master_Slave"; // Alfresco Search Services using master slave configurations - public static final String ASS_MASTER ="ASS_Master"; // Alfresco search services using master/stand alone mode - public static final String EXPLICIT_SHARDING ="Explicit_Sharding"; // Alfresco search services using sharded environment and explicit routing + public static final String CONFIG_MASTER_SLAVE = "CONFIG_Master_Slave"; // Alfresco Search Services using master slave configurations + public static final String CONFIG_MASTER ="CONFIG_Master"; // Alfresco search services using master/stand alone mode - public static final String SHARDING ="Sharding"; // Alfresco search services using sharded environment - - public static final String ASS_SHARDING = "ASS_Sharding"; // Alfresco Search Services using Sharding - public static final String ASS_SHARDING_DB_ID_RANGE = "ASS_Sharding_DB_ID_RANGE"; // Alfresco Search Services using Sharding with DB_ID_RANGE + public static final String CONFIG_SHARDING ="CONFIG_Sharding"; // Alfresco search services using sharded environment + public static final String CONFIG_SHARDING_EXPLICIT ="CONFIG_SHARDING_EXPLICIT"; // Alfresco search services using sharded environment and explicit routing + public static final String CONFIG_SHARDING_DB_ID_RANGE = "CONFIG_SHARDING_DB_ID_RANGE"; // Alfresco Search Services using Sharding with DB_ID_RANGE public static final String NOT_INSIGHT_ENGINE = "Not_InsightEngine"; // When Alfresco Insight Engine 1.0 isn't running diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java index 601fee8d7..2b74d4cc8 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java @@ -21,10 +21,14 @@ import org.alfresco.dataprep.ContentService; import org.alfresco.dataprep.SiteService.Visibility; import org.alfresco.rest.core.RestProperties; import org.alfresco.rest.core.RestWrapper; +import org.alfresco.rest.exception.EmptyRestModelCollectionException; import org.alfresco.rest.model.RestRequestSpellcheckModel; import org.alfresco.rest.search.Pagination; import org.alfresco.rest.search.RestRequestHighlightModel; import org.alfresco.rest.search.RestRequestQueryModel; +import org.alfresco.rest.search.RestShardInfoModel; +import org.alfresco.rest.search.RestShardInfoModelCollection; +import org.alfresco.rest.search.RestShardModel; import org.alfresco.rest.search.SearchRequest; import org.alfresco.rest.search.SearchResponse; import org.alfresco.utility.LogFactory; @@ -49,6 +53,8 @@ import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeSuite; +import com.fasterxml.jackson.core.JsonProcessingException; + /** * @author meenal bhave */ @@ -93,6 +99,9 @@ public abstract class AbstractE2EFunctionalTest extends AbstractTestNGSpringCont protected SiteModel testSite, testSite2; protected static String unique_searchString; + + protected static String shardingMethod = "DB_ID"; + protected int shardCount = 0; protected static final String SEARCH_LANGUAGE_CMIS = "cmis"; @@ -595,4 +604,39 @@ public abstract class AbstractE2EFunctionalTest extends AbstractTestNGSpringCont response.getContext().getSpellCheck().assertThat().field("suggestions").contains(spellCheckSuggestion); } } + + /** + * Method returns the sharding method used for the core by the 1st shard instance registered with ACS + * @return String sharding Method + * @throws JsonProcessingException + * @throws EmptyRestModelCollectionException + */ + public String getShardMethod() throws JsonProcessingException, EmptyRestModelCollectionException + { + RestShardInfoModelCollection info = getShardInfo(); + + shardingMethod = info.getEntryByIndex(0).getShardMethod(); + return shardingMethod; + } + + /** + * Method returns the shardCount for the 1st core (of the shard instance) that registers with ACS + * @return shard Count + * @throws JsonProcessingException + * @throws EmptyRestModelCollectionException + */ + public int getShardCount() throws JsonProcessingException, EmptyRestModelCollectionException + { + RestShardInfoModelCollection info = getShardInfo(); + + shardCount = info.getEntryByIndex(0).getNumberOfShards(); + return shardCount; + } + + public RestShardInfoModelCollection getShardInfo() throws JsonProcessingException, EmptyRestModelCollectionException + { + RestShardInfoModelCollection info = restClient.authenticateUser(dataUser.getAdminUser()).withShardInfoAPI().getInfo(); + + return info; + } } diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java index 6cb5ad50c..798170325 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java @@ -20,7 +20,7 @@ public class ExplicitRoutingTest extends AbstractE2EFunctionalTest { * Checks indexing still works after sharding model used for explicit routing has been disabled * @throws Exception */ - @Test(priority = 1, groups = {TestGroup.NOT_BAMBOO, TestGroup.EXPLICIT_SHARDING, TestGroup.ACS_62n}) + @Test(priority = 1, groups = {TestGroup.NOT_BAMBOO, TestGroup.CONFIG_SHARDING_EXPLICIT, TestGroup.ACS_62n}) public void testIndexingStillWorkingAfterShardModelIsDeactivated() throws Exception { diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java index fe8dd1f9c..70ac4ebd9 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java @@ -44,7 +44,7 @@ import org.springframework.http.HttpStatus; public class ShardInfoTest extends AbstractE2EFunctionalTest { /* The test that will be excluded when running master slave setup, excluding the ASS_MASTER test group. */ - @Test(groups = { TestGroup.ACS_60n, TestGroup.ASS_MASTER }) + @Test(groups = { TestGroup.ACS_60n, TestGroup.CONFIG_MASTER }) public void getShardInfoWithAdminAuthority() throws JsonProcessingException { RestShardInfoModelCollection info = restClient.authenticateUser(dataUser.getAdminUser()).withShardInfoAPI() @@ -89,7 +89,7 @@ public class ShardInfoTest extends AbstractE2EFunctionalTest } /* The test that will be run when in master slave setup by including the ASS_MASTER_SLAVE test group. */ - @Test(groups = {TestGroup.ACS_60n, TestGroup.ASS_MASTER_SLAVE }) + @Test(groups = {TestGroup.ACS_60n, TestGroup.CONFIG_MASTER_SLAVE }) public void getShardInfoWithAdminAuthorityMasterSlaveConfig() throws JsonProcessingException { RestShardInfoModelCollection info = restClient.authenticateUser(dataUser.getAdminUser()).withShardInfoAPI() @@ -139,7 +139,7 @@ public class ShardInfoTest extends AbstractE2EFunctionalTest * @throws JsonProcessingException */ - @Test(groups = { TestGroup.ACS_60n, TestGroup.SHARDING }) + @Test(groups = { TestGroup.ACS_60n, TestGroup.CONFIG_SHARDING }) public void getShardInfoWith2OrMoreShards() throws JsonProcessingException { RestShardInfoModelCollection info = restClient.authenticateUser(dataUser.getAdminUser()).withShardInfoAPI().getInfo(); diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java index a61e2dc63..3c2149f85 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java @@ -187,7 +187,7 @@ public class CascadingIntegrationTest extends AbstractE2EFunctionalTest * Check that, after parent renaming, both the children are searchable in the new path * (computed accordingly with the new parent folder name) */ - @Test(priority = 3, groups = {TestGroup.NOT_BAMBOO, TestGroup.EXPLICIT_SHARDING }) + @Test(priority = 3, groups = {TestGroup.NOT_BAMBOO, TestGroup.CONFIG_SHARDING_EXPLICIT }) public void testChildrenPathOnParentRenamedWithChildrenInDifferentShards() throws Exception { diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java index 91060b11a..a0765ea3e 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java @@ -31,6 +31,7 @@ import org.testng.annotations.Test; * http://:/solr/admin/cores?action=(actionName) * * @author aborroy + * @author mbhave * */ @Configuration @@ -465,7 +466,7 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest * This test verifies expected result when using another deployment * @throws Exception */ - @Test(priority = 20) + @Test(priority = 20, groups = {TestGroup.CONFIG_SHARDING}) public void testRangeCheck() throws Exception { String coreName = "alfresco"; @@ -475,24 +476,17 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest checkResponseStatusOk(response); Integer expand = response.getResponse().body().jsonPath().get("expand"); - Assert.assertEquals(expand, Integer.valueOf(-1), "Expansion is not allowed when not using Shard DB_ID_RANGE method,"); - } - - /** - * When using DB_ID_RANGE Sharding method, expand param is including a number of nodes to be extended. - * @throws Exception - */ - @Test(priority = 21, groups = { TestGroup.ASS_SHARDING_DB_ID_RANGE }) - public void testRangeCheckSharding() throws Exception - { - String coreName = "alfresco"; - - RestResponse response = restClient.withParams("coreName=" + coreName).withSolrAdminAPI().getAction("rangeCheck"); - - checkResponseStatusOk(response); - - Integer expand = response.getResponse().body().jsonPath().get("expand"); - Assert.assertNotEquals(expand, Integer.valueOf(-1), "Expansion is a positive number when using Shard DB_ID_RANGE method,"); + + // RangeCheck action only applies to DB_ID_RANGE Sharding method, so expect error in other sharding methods and success for DB_ID_RANGE + if ("DB_ID_RANGE".equalsIgnoreCase(getShardMethod())) + { + // This assertion replicates: testRangeCheckSharding, priority = 21, hence deleting that test as duplicate + Assert.assertNotEquals(expand, Integer.valueOf(-1), "Expansion is not successful when not using Shard DB_ID_RANGE method,"); + } + else + { + Assert.assertEquals(expand, Integer.valueOf(-1), "Expansion should not have been allowed when not using Shard DB_ID_RANGE method,"); + } } /** @@ -500,7 +494,7 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest * This test verifies expected result when using another deployment * @throws Exception */ - @Test(priority = 22) + @Test(priority = 22, groups = { TestGroup.CONFIG_SHARDING}) public void testExpand() throws Exception { String coreName = "alfresco"; @@ -509,29 +503,19 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest RestResponse response = restClient.withParams("coreName=" + coreName, "add=" + add).withSolrAdminAPI().getAction("expand"); checkResponseStatusOk(response); - - // This action only applies to DB_ID_RANGE Sharding method + Integer expand = response.getResponse().body().jsonPath().get("expand"); - Assert.assertEquals(expand, Integer.valueOf(-1), "Expansion is not allowed when not using Shard DB_ID_RANGE method,"); - } - - /** - * When using DB_ID_RANGE Sharding method, expand param is including a number of nodes extended. - * @throws Exception - */ - @Test(priority = 23, groups = { TestGroup.ASS_SHARDING_DB_ID_RANGE }) - public void testExpandSharding() throws Exception - { - String coreName = "alfresco"; - String add = "1000"; - - RestResponse response = restClient.withParams("coreName=" + coreName, "add=" + add).withSolrAdminAPI().getAction("expand"); - - checkResponseStatusOk(response); - - // This action only applies to DB_ID_RANGE Sharding method - Integer expand = response.getResponse().body().jsonPath().get("expand"); - Assert.assertNotEquals(expand, Integer.valueOf(-1), "Expansion is a positive number when using Shard DB_ID_RANGE method,"); + + // Expand action only applies to DB_ID_RANGE Sharding method, so expect error in other sharding methods and success for DB_ID_RANGE + if ("DB_ID_RANGE".equalsIgnoreCase(getShardMethod())) + { + // This assertion replicates: testExpandSharding, priority = 23, hence deleting that test as duplicate + Assert.assertNotEquals(expand, Integer.valueOf(-1), "Expansion is not successful when not using Shard DB_ID_RANGE method,"); + } + else + { + Assert.assertEquals(expand, Integer.valueOf(-1), "Expansion should not have been allowed when not using Shard DB_ID_RANGE method,"); + } } /** From d8e51786a81a2f8b76d91b8f5ab79e270c781651 Mon Sep 17 00:00:00 2001 From: mbhave Date: Wed, 1 Apr 2020 10:08:08 +0100 Subject: [PATCH 2/4] Search-2142: Updated with sharding method enum and getShardInfo to throw appropriate exception --- .../functional/AbstractE2EFunctionalTest.java | 36 +++++++++++++++---- .../searchServices/search/ShardInfoTest.java | 1 - .../solr/admin/SolrE2eAdminTest.java | 6 ++-- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java index 2b74d4cc8..a8a9b5ba3 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java @@ -11,6 +11,8 @@ import static java.util.Optional.ofNullable; import static lombok.AccessLevel.PROTECTED; import static org.testng.Assert.assertEquals; +import java.util.Collection; +import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -28,7 +30,6 @@ import org.alfresco.rest.search.RestRequestHighlightModel; import org.alfresco.rest.search.RestRequestQueryModel; import org.alfresco.rest.search.RestShardInfoModel; import org.alfresco.rest.search.RestShardInfoModelCollection; -import org.alfresco.rest.search.RestShardModel; import org.alfresco.rest.search.SearchRequest; import org.alfresco.rest.search.SearchResponse; import org.alfresco.utility.LogFactory; @@ -110,6 +111,16 @@ public abstract class AbstractE2EFunctionalTest extends AbstractTestNGSpringCont AFTS } + protected enum ShardingMethod { + DB_ID, + DB_ID_RANGE, + MOD_ACL_ID, + ACL_ID, + DATE, + PROPERTY, + EXPLICIT_ID + } + @BeforeSuite (alwaysRun = true) public void beforeSuite() throws Exception { @@ -614,9 +625,15 @@ public abstract class AbstractE2EFunctionalTest extends AbstractTestNGSpringCont public String getShardMethod() throws JsonProcessingException, EmptyRestModelCollectionException { RestShardInfoModelCollection info = getShardInfo(); - - shardingMethod = info.getEntryByIndex(0).getShardMethod(); - return shardingMethod; + + return shardingMethod = + ofNullable(info) + .map(RestShardInfoModelCollection::getEntries) + .map(Collection::iterator) + .filter(Iterator::hasNext) + .map(Iterator::next) + .map(RestShardInfoModel::getShardMethod) + .orElseThrow( () -> new RuntimeException("Cannot retrieve the shard method in use.")); } /** @@ -628,9 +645,14 @@ public abstract class AbstractE2EFunctionalTest extends AbstractTestNGSpringCont public int getShardCount() throws JsonProcessingException, EmptyRestModelCollectionException { RestShardInfoModelCollection info = getShardInfo(); - - shardCount = info.getEntryByIndex(0).getNumberOfShards(); - return shardCount; + + return shardCount = ofNullable(info) + .map(RestShardInfoModelCollection::getEntries) + .map(Collection::iterator) + .filter(Iterator::hasNext) + .map(Iterator::next) + .map(RestShardInfoModel::getNumberOfShards) + .orElseThrow( () -> new RuntimeException("Cannot retrieve the number of shards registered.")); } public RestShardInfoModelCollection getShardInfo() throws JsonProcessingException, EmptyRestModelCollectionException diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java index 70ac4ebd9..4a0cb1b39 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ShardInfoTest.java @@ -20,7 +20,6 @@ import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import java.util.Arrays; -import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.stream.Collectors; diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java index a0765ea3e..52cbc65f9 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java @@ -478,7 +478,7 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest Integer expand = response.getResponse().body().jsonPath().get("expand"); // RangeCheck action only applies to DB_ID_RANGE Sharding method, so expect error in other sharding methods and success for DB_ID_RANGE - if ("DB_ID_RANGE".equalsIgnoreCase(getShardMethod())) + if (ShardingMethod.DB_ID_RANGE.toString().equalsIgnoreCase(getShardMethod())) { // This assertion replicates: testRangeCheckSharding, priority = 21, hence deleting that test as duplicate Assert.assertNotEquals(expand, Integer.valueOf(-1), "Expansion is not successful when not using Shard DB_ID_RANGE method,"); @@ -504,10 +504,10 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest checkResponseStatusOk(response); - Integer expand = response.getResponse().body().jsonPath().get("expand"); + Integer expand = response.getResponse().body().jsonPath().get("expand"); // Expand action only applies to DB_ID_RANGE Sharding method, so expect error in other sharding methods and success for DB_ID_RANGE - if ("DB_ID_RANGE".equalsIgnoreCase(getShardMethod())) + if (ShardingMethod.DB_ID_RANGE.toString().equalsIgnoreCase(getShardMethod())) { // This assertion replicates: testExpandSharding, priority = 23, hence deleting that test as duplicate Assert.assertNotEquals(expand, Integer.valueOf(-1), "Expansion is not successful when not using Shard DB_ID_RANGE method,"); From 59797a443855c3f6a93cf7cad98db549d91587e1 Mon Sep 17 00:00:00 2001 From: mbhave Date: Wed, 1 Apr 2020 13:01:53 +0100 Subject: [PATCH 3/4] Removed unused TestGroups --- e2e-test/src/main/java/org/alfresco/search/TestGroup.java | 6 ++---- .../searchServices/search/ExplicitRoutingTest.java | 2 +- .../search/tracker/CascadingIntegrationTest.java | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/e2e-test/src/main/java/org/alfresco/search/TestGroup.java b/e2e-test/src/main/java/org/alfresco/search/TestGroup.java index 49a0bb8c2..8da8c14e8 100644 --- a/e2e-test/src/main/java/org/alfresco/search/TestGroup.java +++ b/e2e-test/src/main/java/org/alfresco/search/TestGroup.java @@ -31,8 +31,8 @@ public class TestGroup public static final String CONFIG_MASTER ="CONFIG_Master"; // Alfresco search services using master/stand alone mode public static final String CONFIG_SHARDING ="CONFIG_Sharding"; // Alfresco search services using sharded environment - public static final String CONFIG_SHARDING_EXPLICIT ="CONFIG_SHARDING_EXPLICIT"; // Alfresco search services using sharded environment and explicit routing - public static final String CONFIG_SHARDING_DB_ID_RANGE = "CONFIG_SHARDING_DB_ID_RANGE"; // Alfresco Search Services using Sharding with DB_ID_RANGE + public static final String CONFIG_SHARDING_EXPLICIT ="CONFIG_Sharding_EXPLICIT"; // Alfresco search services using sharded environment and explicit routing + public static final String CONFIG_SHARDING_DB_ID_RANGE = "CONFIG_Sharding_DB_ID_RANGE"; // Alfresco Search Services using Sharding with DB_ID_RANGE public static final String NOT_INSIGHT_ENGINE = "Not_InsightEngine"; // When Alfresco Insight Engine 1.0 isn't running @@ -44,6 +44,4 @@ public class TestGroup public static final String ACS_63n = "ACS_63n"; // Alfresco Content Services 6.3 or above public static final String AGS_302 = "AGS_302"; // Alfresco governance Services 3.0.2 or above - - public static final String NOT_BAMBOO = "Not_Bamboo"; // The does not run on bamboo } diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java index 798170325..576bfacfb 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/ExplicitRoutingTest.java @@ -20,7 +20,7 @@ public class ExplicitRoutingTest extends AbstractE2EFunctionalTest { * Checks indexing still works after sharding model used for explicit routing has been disabled * @throws Exception */ - @Test(priority = 1, groups = {TestGroup.NOT_BAMBOO, TestGroup.CONFIG_SHARDING_EXPLICIT, TestGroup.ACS_62n}) + @Test(priority = 1, groups = {TestGroup.CONFIG_SHARDING, TestGroup.CONFIG_SHARDING_EXPLICIT, TestGroup.ACS_62n}) public void testIndexingStillWorkingAfterShardModelIsDeactivated() throws Exception { diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java index 3c2149f85..75b601800 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/tracker/CascadingIntegrationTest.java @@ -187,7 +187,7 @@ public class CascadingIntegrationTest extends AbstractE2EFunctionalTest * Check that, after parent renaming, both the children are searchable in the new path * (computed accordingly with the new parent folder name) */ - @Test(priority = 3, groups = {TestGroup.NOT_BAMBOO, TestGroup.CONFIG_SHARDING_EXPLICIT }) + @Test(priority = 3, groups = {TestGroup.CONFIG_SHARDING, TestGroup.CONFIG_SHARDING_EXPLICIT }) public void testChildrenPathOnParentRenamedWithChildrenInDifferentShards() throws Exception { From 468ea91f766d3976d4f2ef35cbb46eee6ee3b570 Mon Sep 17 00:00:00 2001 From: mbhave Date: Thu, 2 Apr 2020 14:07:32 +0100 Subject: [PATCH 4/4] Search-2142: Added missing call to getModel to get the shard method and count --- .../functional/AbstractE2EFunctionalTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java index a8a9b5ba3..71fdba621 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/AbstractE2EFunctionalTest.java @@ -626,14 +626,13 @@ public abstract class AbstractE2EFunctionalTest extends AbstractTestNGSpringCont { RestShardInfoModelCollection info = getShardInfo(); - return shardingMethod = - ofNullable(info) - .map(RestShardInfoModelCollection::getEntries) - .map(Collection::iterator) - .filter(Iterator::hasNext) - .map(Iterator::next) - .map(RestShardInfoModel::getShardMethod) - .orElseThrow( () -> new RuntimeException("Cannot retrieve the shard method in use.")); + return shardingMethod = ofNullable(info) + .map(RestShardInfoModelCollection::getEntries) + .map(Collection::iterator).filter(Iterator::hasNext) + .map(Iterator::next) + .map(RestShardInfoModel::getModel) + .map(RestShardInfoModel::getShardMethod) + .orElseThrow(() -> new RuntimeException("Cannot retrieve the shard method in use.")); } /** @@ -651,6 +650,7 @@ public abstract class AbstractE2EFunctionalTest extends AbstractTestNGSpringCont .map(Collection::iterator) .filter(Iterator::hasNext) .map(Iterator::next) + .map(RestShardInfoModel::getModel) .map(RestShardInfoModel::getNumberOfShards) .orElseThrow( () -> new RuntimeException("Cannot retrieve the number of shards registered.")); }