Add Docker Compose-backed Test Resources service discovery#1069
Add Docker Compose-backed Test Resources service discovery#1069alvarosanchez wants to merge 103 commits into
Conversation
0878816 to
cc0214c
Compare
8d988a4 to
5e8050e
Compare
|
Can we have a summary about how this is supposed to work/be configured? Does the user need to expose each and every property? How does that work in combination with the inference mode (e.g if the inference determines that we need a postgres container BUT that it is supposed to be handled by compose, how does that work?). Who manages the lifecycle of the containers (that is to say clarify if compose is started/shutdown by test resources and therefore it will be "naturally" handled by the build plugins, or, if the docker compose is deemed to be started externally, in which case the lifecycle management is unclear). |
|
@melix I updated the PR summary with the intended operating model. Short version:
The user-facing guide section in ✨ This message was AI-generated using gpt-5 |
Alright, so it looks like it's "guessing" properties somehow, which also means that it is very specific to what we support. This can be surprising to users, but I guess we'll figure out.
My question is then: how is priority handled? We normally don't support 2 providers that can provide the same property, or one would be randomly picked. How do you make sure that the compose one has highest priority? Is it just the intended behavior?
That reinforces my previous question.
This seems to be designed without considering the build tooling, which IS the piece responsible for the lifecycle of the test resources service. I'm a bit afraid that having a combination of keep alive test resources service with compose start = true/false might be tricky to understand. Maybe a matrix showing the implications of the design decisions would be helpful. |
|
@melix I pushed a docs-only follow-up that spells out the two pieces that were still implicit. On priority: Compose is not relying on random ServiceLoader ordering. The Compose-aware provider variants use the earlier resolver order and, when Compose is enabled and the compose module advertises a replacement, the original matching Testcontainers provider instance is disabled. Fallback is inside the Compose-aware provider: it tries Compose first, then delegates to the normal provider startup path when there is no unambiguous Compose service. On lifecycle: the guide now has a matrix for per-build servers, keep-alive/shared servers, Verification: ✨ This message was AI-generated using gpt-5.5 |
|
I created a standalone sample Micronaut application for this PR. It includes:
I validated the sample Gradle configuration with The ZIP is attached to Paperclip DEV-261 as The PR is otherwise clean on head ✨ This message was AI-generated using gpt-5.5 |
|
…ompose-backed-test-resources-service-discovery # Conflicts: # test-resources-localstack/test-resources-localstack-core/build.gradle
|
…ompose-backed-test-resources-service-discovery # Conflicts: # test-resources-kafka/src/main/java/io/micronaut/testresources/kafka/KafkaTestResourceProvider.java
|
Micronaut Engineer follow-through update for DEV-261. I pushed Local verification:
Same-head status after push: Vulnerability Audit, GraalVM/build matrix, and CLA are passing. The Java CI Paperclip note: I attempted to update the DEV-261 implementation artifact and route back to Code Reviewer, but the Paperclip API rejected this heartbeat with an issue run ownership conflict: issue checkout/execution run ✨ This message was AI-generated using gpt-5.5 |
|



Summary
micronaut-test-resources-composemodule for Docker Compose-backed Micronaut Test Resources resolution.4.1.xafter the4.0.xrelease-policy exception was rejected.ComposeContaineroverlay to resolve supported missing properties from Compose services before normal providers start their default containers.test-resources.compose.enabled=trueand the optional compose module is present on the Test Resources server classpath.micronaut-test-resources-composesupplies shared lifecycle, parsing, matching, and lookup support but no central service catalog.Fixes #1068
Ready For Review
Implementation follow-up is pushed at head
ee0075709690ecf19940a4f4f97804745fd34672. This head adds the Floci core non-Compose rationale required after4.1.xintroduced Floci as a resolver-backed module, keeping the Compose guide inventory consistent with the coverage test.Verification
Local verification for head
ee0075709690ecf19940a4f4f97804745fd34672:./gradlew --no-daemon :micronaut-test-resources-compose:test --tests "io.micronaut.testresources.compose.ComposeTestResourcesResolverSpec.compose coverage inventory covers every resolver backed provider module" --stacktrace./gradlew --no-daemon :micronaut-test-resources-compose:check --stacktracegit diff --check origin/4.1.x...HEADgit diff --checkSame-head external status for head
ee0075709690ecf19940a4f4f97804745fd34672:CLEAN.build (25), Java CI test report, GraalVM Latest CIbuild_matrixandbuild (25), Vulnerability Auditaudit (25), SonarCloud, and CLA.Project Targeting
QA selected the Micronaut organization project
5.1.0 Releasefor the retargeted4.1.xpath. The previous5.0.0-M3and5.0.0 Releaseproject links were removed.Reviewer Routing
The linked GitHub issue creator is
alvarosanchez. GitHub previously rejected requesting that account as a reviewer because this PR was created by the same authenticated GitHub user:Review cannot be requested from pull request author. (HTTP 422).✨ This message was AI-generated using gpt-5.5