[JIRA] (HSEARCH-4715) Simplify Maven profiles and groups for Elasticsearch testing
by Yoann Rodière (JIRA)
Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *created* an issue
Hibernate Search ( https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiMTI4MDAz... ) / Task ( https://hibernate.atlassian.net/browse/HSEARCH-4715?atlOrigin=eyJpIjoiMTI... ) HSEARCH-4715 ( https://hibernate.atlassian.net/browse/HSEARCH-4715?atlOrigin=eyJpIjoiMTI... ) Simplify Maven profiles and groups for Elasticsearch testing ( https://hibernate.atlassian.net/browse/HSEARCH-4715?atlOrigin=eyJpIjoiMTI... )
Issue Type: Task Assignee: Unassigned Components: build, integration, tests Created: 11/Oct/2022 00:23 AM Fix Versions: 6.2-backlog Priority: Major Reporter: Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
Elasticsearch testing is set up this way:
* In the Jenkinsfile, we enable a profile (e.g. elasticsearch-6.0)
* In Maven, in the parent POM for integration tests, that profile defines what we will be testing against ( https://github.com/hibernate/hibernate-search/blob/aaa193330ced3a5858daa0... ) : the distribution ( elastic ) and the exact version (e.g. 6.2.4 ), as well as the container image (OpenSearch vs. Elastic, via test.elasticsearch.run.elastic.skip / test.elasticsearch.run.opensearch.skip ).
* In Maven, in the parent POM for integration tests, that profile used to set up “test dialects” ( https://github.com/hibernate/hibernate-search/blob/aaa193330ced3a5858daa0... ) , but that’s no longer the case after https://hibernate.atlassian.net/browse/HSEARCH-4705 ( https://hibernate.atlassian.net/browse/HSEARCH-4705 ).
* In Maven, in the POM of specific integration tests, that profile defines excluded JUnit Categories ( https://github.com/hibernate/hibernate-search/blob/37629846de5d1ccd1ffd99... ) , so that we don’t execute some tests that are irrelevant for that version.
This is all quite complicated, so I think we should try to do better:
* In the Jenkinsfile, we set the full distribution and version explicitly, not a profile. I.e. we use -Dtest.elasticsearch.connection.distribution=... -Dtest.elasticsearch.connection.version=...
For AWS, we will have to provide an approximation of the version that we expect to run on the AWS Service.
* In Maven, in the parent POM for integration tests, we enable one of two profiles ( opensearch / elastic ) according to the distribution that was set explicitly, just to define the container image (OpenSearch vs. Elastic, via test.elasticsearch.run.elastic.skip / test.elasticsearch.run.opensearch.skip ).
* For tests that cannot run against all versions, instead of using JUnit Categories, we will just use assume and test the actual version of Elasticsearch, like we do in TCK tests with ElasticsearchTckBackendFeatures.
Later when we switch to JUnit 5 ( https://hibernate.atlassian.net/browse/HSEARCH-3654 ( https://hibernate.atlassian.net/browse/HSEARCH-3654 ) ), we might be able to improve on that and simply rely on annotations; but we’re not there yet.
Advantages:
* It’s simpler
* It’s more versatile: you can more easily test any version of Elasticsearch/OpenSearch.
* It’s clearer: instead of displaying a version range on CI, we can display the exact version we expect to run against.
Additionally, we may be able to simplify the -Dtest.elasticsearch.connection.distribution=elastic -Dtest.elasticsearch.connection.version=7.10.2 to just -Dtest.elasticsearch.version=elastic:7.10.2 ; but that will only be possible if we can enable profiles based on patterns ( elastic: ** */ opensearch:* ). I’m not sure that’s possible. Maybe a middleground would be to remove.connection from the property names.
( https://hibernate.atlassian.net/browse/HSEARCH-4715#add-comment?atlOrigin... ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-4715#add-comment?atlOrigin... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100208- sha1:38b2e23 )
2 years, 3 months