Skip to content

Conversation

@jkiddo
Copy link
Collaborator

@jkiddo jkiddo commented Nov 23, 2025

No description provided.

@jkiddo jkiddo requested a review from Copilot November 23, 2025 20:55
Copilot finished reviewing on behalf of jkiddo November 23, 2025 20:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR re-enables Elasticsearch integration tests by updating test infrastructure, creating a new test configuration class for Elasticsearch clients, and updating dependencies. The changes address test failures and remove the @Disabled annotation from the test class.

  • Created TestElasticsearchClientConfig to provide Elasticsearch client beans for tests
  • Updated ElasticsearchLastNR4IT to use embedded Elasticsearch container with proper initialization
  • Refactored ElasticsearchBootSvcImpl to use consistent naming for the Elasticsearch client field
  • Updated Testcontainers dependencies with explicit version declarations

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/test/java/ca/uhn/fhir/jpa/starter/elastic/TestElasticsearchClientConfig.java New test configuration class for creating and managing Elasticsearch client beans with authentication support
src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java Updated test class with embedded Elasticsearch container initialization, ngram configuration, and removed @disabled annotation
src/main/java/ca/uhn/fhir/jpa/starter/elastic/ElasticsearchBootSvcImpl.java Renamed private field from myRestHighLevelClient to elasticsearchClient for consistency
pom.xml Updated Testcontainers dependencies with explicit versions and modified artifact IDs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jkiddo
Copy link
Collaborator Author

jkiddo commented Nov 24, 2025

@XcrigX will you have a look?

Copy link
Contributor

@dotasek dotasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall change looks good to me, as the test now passes as intended, but could use some documentation regarding the now absent test helpers. See commentary.

private FhirContext ourCtx;

@Container
public static ElasticsearchContainer embeddedElastic = TestElasticsearchContainerHelper.getEmbeddedElasticSearch();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to these helper classes? I do not find them indexed in my IDE when testing locally.

Is there an associated change in HAPI or otherwise that is related to this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and now I've reverted back to 7.17.3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a discussion with @tadgh about this earlier in the week, and we agreed it would be appropriate to update TestElasticsearchContainerHelper to the latest 8.x.x version.

I'm setting up a branch for that right now, and I'll see if these two will work together.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit premature probably but what about 9.x or switching to opensearch ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit premature probably but what about 9.x or switching to opensearch ?

@jkiddo jkiddo marked this pull request as draft November 25, 2025 08:35
@jkiddo jkiddo marked this pull request as ready for review November 25, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants