Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSEARCH-4214 follow-up (backport to 6.0): fix tests on Elasticsearch 5.6 #2558

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.ConfigurationPropertySource;
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 {
}