Skip to content

Commit

Permalink
HSEARCH-4214 Disable tests requiring a single model dialect per major…
Browse files Browse the repository at this point in the history
… when testing ES5.6
  • Loading branch information
yrodiere committed Apr 23, 2021
1 parent edadf64 commit 91fcb30
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion integrationtest/backend/elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
<properties>
<failsafe.excludedGroups.elasticsearch.version>
,
org.hibernate.search.integrationtest.backend.elasticsearch.testsupport.categories.RequiresIndexAliasIsWriteIndex
org.hibernate.search.integrationtest.backend.elasticsearch.testsupport.categories.RequiresIndexAliasIsWriteIndex,
org.hibernate.search.integrationtest.backend.elasticsearch.testsupport.categories.RequiresSingleModelDialectForMajorVersion
</failsafe.excludedGroups.elasticsearch.version>
</properties>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.hibernate.search.backend.elasticsearch.client.spi.ElasticsearchRequest;
import org.hibernate.search.engine.cfg.BackendSettings;
import org.hibernate.search.engine.cfg.spi.AllAwareConfigurationPropertySource;
import org.hibernate.search.integrationtest.backend.elasticsearch.testsupport.categories.RequiresSingleModelDialectForMajorVersion;
import org.hibernate.search.integrationtest.backend.elasticsearch.testsupport.util.ElasticsearchClientSpy;
import org.hibernate.search.integrationtest.backend.elasticsearch.testsupport.util.ElasticsearchRequestAssertionMode;
import org.hibernate.search.integrationtest.backend.tck.testsupport.util.rule.SearchSetupHelper;
Expand All @@ -31,6 +32,7 @@

import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

public class ElasticsearchBootstrapIT {

Expand Down Expand Up @@ -111,6 +113,7 @@ public void noVersionCheck_missingVersion() {
* while specifying only the major number of the Elasticsearch version.
*/
@Test
@Category(RequiresSingleModelDialectForMajorVersion.class)
@TestForIssue(jiraKey = "HSEARCH-3841")
public void noVersionCheck_incompleteVersion() {
ElasticsearchVersion clusterVersion = ElasticsearchVersion.of( ElasticsearchTestDialect.getClusterVersion() );
Expand Down Expand Up @@ -184,6 +187,7 @@ public void noVersionCheck_completeVersion() {
* and specifying a version on backend creation, and a different one on backend start.
*/
@Test
@Category(RequiresSingleModelDialectForMajorVersion.class)
@TestForIssue(jiraKey = "HSEARCH-4214")
public void noVersionCheck_versionOverrideOnStart_incompatibleVersion() {
ElasticsearchVersion clusterVersion = ElasticsearchVersion.of( ElasticsearchTestDialect.getClusterVersion() );
Expand Down Expand Up @@ -230,6 +234,7 @@ public void noVersionCheck_versionOverrideOnStart_incompatibleVersion() {
* and specifying a version on backend creation, and a more precise one on backend start.
*/
@Test
@Category(RequiresSingleModelDialectForMajorVersion.class)
@TestForIssue(jiraKey = "HSEARCH-4214")
public void noVersionCheck_versionOverrideOnStart_compatibleVersion() {
ElasticsearchVersion clusterVersion = ElasticsearchVersion.of( ElasticsearchTestDialect.getClusterVersion() );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.integrationtest.backend.elasticsearch.testsupport.categories;

/**
* JUnit category marker indicating that a test is only relevant
* for Elasticsearch major versions where all minor versions
* use the same model dialect.
* <p>
* It is not the case on ES 5 in particular, since 5.6 has a dialect
* but 5.0, 5.1, etc. don't have one.
*/
public class RequiresSingleModelDialectForMajorVersion {
}

0 comments on commit 91fcb30

Please sign in to comment.