Skip to content

Commit

Permalink
Merge pull request #35446 from yrodiere/es-8.9-os-2.9
Browse files Browse the repository at this point in the history
Bump Elasticsearch/OpenSearch server version for tests and dev services to 8.9/2.9
  • Loading branch information
yrodiere authored Aug 23, 2023
2 parents d422fc3 + 1eb4abf commit dd8c3a1
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 41 deletions.
4 changes: 2 additions & 2 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@
<volume.access.modifier>:Z</volume.access.modifier>

<!-- Defaults for integration tests -->
<elasticsearch-server.version>8.8.2</elasticsearch-server.version>
<elasticsearch-server.version>8.9.1</elasticsearch-server.version>
<elasticsearch.image>docker.io/elastic/elasticsearch:${elasticsearch-server.version}</elasticsearch.image>
<logstash.image>docker.io/elastic/logstash:${elasticsearch-server.version}</logstash.image>
<kibana.image>docker.io/elastic/kibana:${elasticsearch-server.version}</kibana.image>
<elasticsearch.protocol>http</elasticsearch.protocol>
<opensearch-server.version>1.2.3</opensearch-server.version>
<opensearch-server.version>2.9.0</opensearch-server.version>
<opensearch.image>docker.io/opensearchproject/opensearch:${opensearch-server.version}</opensearch.image>
<opensearch.protocol>http</opensearch.protocol>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ private GenericContainer<?> createElasticsearchContainer(ElasticsearchDevService
// Disable disk-based shard allocation thresholds:
// in a single-node setup they just don't make sense,
// and lead to problems on large disks with little space left.
// See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
// See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/modules-cluster.html#disk-based-shard-allocation
container.addEnv("cluster.routing.allocation.disk.threshold_enabled", "false");
container.addEnv("ES_JAVA_OPTS", config.javaOpts);
return container;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1

quarkus.hibernate-orm.database.generation=drop-and-create

quarkus.hibernate-search-orm.elasticsearch.version=8.8
quarkus.hibernate-search-orm.elasticsearch.version=8.9
# Simulate an offline Elasticsearch instance by pointing to a non-existing cluster
quarkus.hibernate-search-orm.elasticsearch.hosts=localhost:14800
quarkus.hibernate-search-orm.schema-management.strategy=none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public class DevUIHibernateSearchActiveFalseAndNamedPuActiveTrueTest extends Abs
+ "quarkus.hibernate-orm.datasource=<default>\n"
+ "quarkus.hibernate-orm.packages=io.quarkus.test.devui\n"
+ "quarkus.hibernate-search-orm.active=false\n"
+ "quarkus.hibernate-search-orm.elasticsearch.version=8.8\n"
+ "quarkus.hibernate-search-orm.elasticsearch.version=8.9\n"
// ... but it's (implicitly) active for a named PU
+ "quarkus.hibernate-orm.\"namedpu\".datasource=nameddatasource\n"
+ "quarkus.hibernate-orm.\"namedpu\".packages=io.quarkus.test.devui.namedpu\n"
+ "quarkus.hibernate-search-orm.\"namedpu\".elasticsearch.version=8.8\n"
+ "quarkus.hibernate-search-orm.\"namedpu\".elasticsearch.version=8.9\n"
// Start Hibernate Search offline for the named PU,
// because we don't have dev services except for the default PU
+ "quarkus.hibernate-search-orm.\"namedpu\".schema-management.strategy=none\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DevUIHibernateSearchActiveFalseTest extends AbstractDevUIHibernateS
+ "quarkus.datasource.jdbc.url=jdbc:h2:mem:test\n"
// Hibernate Search is inactive: the dev console should be empty.
+ "quarkus.hibernate-search-orm.active=false\n"
+ "quarkus.hibernate-search-orm.elasticsearch.version=8.8\n"),
+ "quarkus.hibernate-search-orm.elasticsearch.version=8.9\n"),
"application.properties")
.addClasses(MyIndexedEntity.class));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DevUIHibernateSearchSmokeTest extends AbstractDevUIHibernateSearchT
.withApplicationRoot((jar) -> jar.addAsResource(
new StringAsset("quarkus.datasource.db-kind=h2\n"
+ "quarkus.datasource.jdbc.url=jdbc:h2:mem:test\n"
+ "quarkus.hibernate-search-orm.elasticsearch.version=8.8\n"
+ "quarkus.hibernate-search-orm.elasticsearch.version=8.9\n"
// Start offline, we don't have an Elasticsearch cluster here
+ "quarkus.hibernate-search-orm.schema-management.strategy=none\n"
+ "quarkus.hibernate-search-orm.elasticsearch.version-check.enabled=false\n"),
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/elasticsearch-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<!-- Disable disk-based shard allocation thresholds:
in a single-node setup they just don't make sense,
and lead to problems on large disks with little space left.
See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/modules-cluster.html#disk-based-shard-allocation
-->
<cluster.routing.allocation.disk.threshold_enabled>false</cluster.routing.allocation.disk.threshold_enabled>
<!-- Disable some features that are not needed in our tests and just slow down startup -->
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/elasticsearch-rest-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<!-- Disable disk-based shard allocation thresholds:
in a single-node setup they just don't make sense,
and lead to problems on large disks with little space left.
See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/modules-cluster.html#disk-based-shard-allocation
-->
<cluster.routing.allocation.disk.threshold_enabled>false</cluster.routing.allocation.disk.threshold_enabled>
<!-- Disable some features that are not needed in our tests and just slow down startup -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<!-- Disable disk-based shard allocation thresholds:
in a single-node setup they just don't make sense,
and lead to problems on large disks with little space left.
See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/modules-cluster.html#disk-based-shard-allocation
-->
<cluster.routing.allocation.disk.threshold_enabled>false</cluster.routing.allocation.disk.threshold_enabled>
<!-- Disable some features that are not needed in our tests and just slow down startup -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<!-- Disable disk-based shard allocation thresholds:
in a single-node setup they just don't make sense,
and lead to problems on large disks with little space left.
See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/modules-cluster.html#disk-based-shard-allocation
-->
<cluster.routing.allocation.disk.threshold_enabled>false</cluster.routing.allocation.disk.threshold_enabled>
<!-- Disable some features that are not needed in our tests and just slow down startup -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<!-- Disable disk-based shard allocation thresholds:
in a single-node setup they just don't make sense,
and lead to problems on large disks with little space left.
See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/modules-cluster.html#disk-based-shard-allocation
-->
<cluster.routing.allocation.disk.threshold_enabled>false</cluster.routing.allocation.disk.threshold_enabled>
<!-- Disable some features that are not needed in our tests and just slow down startup -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ public Map<String, String> getConfigOverrides() {
// we won't have an Elasticsearch instance to talk to.
config.putAll(Map.of(
"quarkus.hibernate-search-orm.schema-management.strategy", "none",
// This version does not matter as long as it's supported by Hibernate Search:
// it won't be checked in this test anyway.
"quarkus.hibernate-search-orm.elasticsearch.version", "7.5",
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false"));
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false",
// When disabling the version check we need to set a more precise version
// than what we have in application.properties.
// But here it doesn't matter as we won't send a request to Elasticsearch anyway,
// so we're free to put anything.
// Just make sure to set something consistent with what we have in application.properties.
"quarkus.hibernate-search-orm.elasticsearch.version", "8.9"));
return config;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ public Map<String, String> getConfigOverrides() {
"quarkus.hibernate-search-orm.elasticsearch.hosts", EXPLICIT_HOSTS,
// Ensure we can work offline, because the host we set just above does not actually exist.
"quarkus.hibernate-search-orm.schema-management.strategy", "none",
// This version does not matter as long as it's supported by Hibernate Search:
// it won't be checked in this test anyway.
"quarkus.hibernate-search-orm.elasticsearch.version", "7.6",
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false");
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false",
// When disabling the version check we need to set a more precise version
// than what we have in application.properties.
// But here it doesn't matter as we won't send a request to Elasticsearch anyway,
// so we're free to put anything.
// Just make sure to set something consistent with what we have in application.properties.
"quarkus.hibernate-search-orm.elasticsearch.version", "8.9");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ quarkus.datasource.jdbc.max-size=8

quarkus.hibernate-orm.database.generation=drop-and-create

quarkus.hibernate-search-orm.elasticsearch.version=opensearch:1.2
quarkus.hibernate-search-orm.elasticsearch.version=opensearch:2
quarkus.hibernate-search-orm.elasticsearch.analysis.configurer=bean:backend-analysis
quarkus.hibernate-search-orm.schema-management.strategy=drop-and-create-and-drop
quarkus.hibernate-search-orm.indexing.plan.synchronization.strategy=sync

# Use drop-and-create instead of drop-and-create-and-drop
# so we can differentiate between the value we set here
# and the value set automatically by the extension when using dev services
# See io.quarkus.it.hibernate.search.orm.opensearch.devservices.HibernateSearchElasticsearchDevServicesEnabledImplicitlyTest.testHibernateSearch
# See io.quarkus.it.hibernate.search.orm.opensearch.devservices.HibernateSearchOpenSearchDevServicesEnabledImplicitlyTest.testHibernateSearch
%test.quarkus.hibernate-search-orm.schema-management.strategy=drop-and-create
%test.quarkus.hibernate-search-orm.elasticsearch.hosts=${opensearch.hosts:localhost:9200}
%test.quarkus.hibernate-search-orm.elasticsearch.protocol=${opensearch.protocol:http}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@

@QuarkusTest
@DisabledOnOs(OS.WINDOWS)
@TestProfile(HibernateSearchElasticsearchDevServicesConfiguredExplicitlyTest.Profile.class)
public class HibernateSearchElasticsearchDevServicesConfiguredExplicitlyTest {
@TestProfile(HibernateSearchOpenSearchDevServicesConfiguredExplicitlyTest.Profile.class)
public class HibernateSearchOpenSearchDevServicesConfiguredExplicitlyTest {
public static class Profile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of(
"quarkus.elasticsearch.devservices.enabled", "true",
// This needs to be different from the default image, or the test makes no sense.
"quarkus.elasticsearch.devservices.image-name", "docker.io/opensearchproject/opensearch:2.6.0",
"quarkus.hibernate-search-orm.elasticsearch.version", "opensearch:2");
// This needs to match the version used just above,
// so that Hibernate Search itself will assert that we're using a custom version.
"quarkus.hibernate-search-orm.elasticsearch.version", "opensearch:2.6");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

@QuarkusTest
@DisabledOnOs(OS.WINDOWS)
@TestProfile(HibernateSearchElasticsearchDevServicesDisabledExplicitlyTest.Profile.class)
public class HibernateSearchElasticsearchDevServicesDisabledExplicitlyTest {
@TestProfile(HibernateSearchOpenSearchDevServicesDisabledExplicitlyTest.Profile.class)
public class HibernateSearchOpenSearchDevServicesDisabledExplicitlyTest {
public static class Profile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
Expand All @@ -32,10 +32,13 @@ public Map<String, String> getConfigOverrides() {
// we won't have an Elasticsearch instance to talk to.
config.putAll(Map.of(
"quarkus.hibernate-search-orm.schema-management.strategy", "none",
// This version does not matter as long as it's supported by Hibernate Search:
// it won't be checked in this test anyway.
"quarkus.hibernate-search-orm.elasticsearch.version", "opensearch:2.9.0",
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false"));
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false",
// When disabling the version check we need to set a more precise version
// than what we have in application.properties.
// But here it doesn't matter as we won't send a request to OpenSearch anyway,
// so we're free to put anything.
// Just make sure to set something consistent with what we have in application.properties.
"quarkus.hibernate-search-orm.elasticsearch.version", "opensearch:2.9"));
return config;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

@QuarkusTest
@DisabledOnOs(OS.WINDOWS)
@TestProfile(HibernateSearchElasticsearchDevServicesDisabledImplicitlyTest.Profile.class)
public class HibernateSearchElasticsearchDevServicesDisabledImplicitlyTest {
@TestProfile(HibernateSearchOpenSearchDevServicesDisabledImplicitlyTest.Profile.class)
public class HibernateSearchOpenSearchDevServicesDisabledImplicitlyTest {
private static final String EXPLICIT_HOSTS = "mycompany.com:4242";

public static class Profile implements QuarkusTestProfile {
Expand All @@ -31,10 +31,13 @@ public Map<String, String> getConfigOverrides() {
"quarkus.hibernate-search-orm.elasticsearch.hosts", EXPLICIT_HOSTS,
// Ensure we can work offline, because the host we set just above does not actually exist.
"quarkus.hibernate-search-orm.schema-management.strategy", "none",
// This version does not matter as long as it's supported by Hibernate Search:
// it won't be checked in this test anyway.
"quarkus.hibernate-search-orm.elasticsearch.version", "opensearch:2.9.0",
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false");
"quarkus.hibernate-search-orm.elasticsearch.version-check.enabled", "false",
// When disabling the version check we need to set a more precise version
// than what we have in application.properties.
// But here it doesn't matter as we won't send a request to OpenSearch anyway,
// so we're free to put anything.
// Just make sure to set something consistent with what we have in application.properties.
"quarkus.hibernate-search-orm.elasticsearch.version", "opensearch:2.9");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

@QuarkusTest
@DisabledOnOs(OS.WINDOWS)
@TestProfile(HibernateSearchElasticsearchDevServicesEnabledImplicitlyTest.Profile.class)
public class HibernateSearchElasticsearchDevServicesEnabledImplicitlyTest {
@TestProfile(HibernateSearchOpenSearchDevServicesEnabledImplicitlyTest.Profile.class)
public class HibernateSearchOpenSearchDevServicesEnabledImplicitlyTest {
public static class Profile implements QuarkusTestProfile {

@Override
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/logging-gelf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<!-- Disable disk-based shard allocation thresholds:
in a single-node setup they just don't make sense,
and lead to problems on large disks with little space left.
See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/modules-cluster.html#disk-based-shard-allocation
-->
<cluster.routing.allocation.disk.threshold_enabled>false</cluster.routing.allocation.disk.threshold_enabled>
<!-- Disable some features that are not needed in our tests and just slow down startup -->
Expand Down

0 comments on commit dd8c3a1

Please sign in to comment.