Closed iompo closed 1 year ago
/cc @evanchooly (mongodb), @geoand (devservices), @loicmathieu (mongodb), @stuartwdouglas (devservices)
The problem is in your MongoResource
.
You need to do:
String connectionUrl = String.format("mongodb://%s:%s@%s:%d", USERNAME, PASSWORD,container.getContainerName().substring(1), DB_PORT);
instead of what you are currently doing.
Hi @geoand, I tried, but that doesn't seem to solve the issue. The start method is never called.
I've updated the reproducer with the connection url fix. The test fails but no container is started and the mongo image is never pulled from the registry.
Describe the bug
I defined a QuarkusTestResourceLifecycleManager that start a mongo instance and set the quarkus.mongodb.devservices.enabled to false. The test fails without even trying to start the mongo container.
Expected behavior
Test run should start the mongo container first and then run the test
Actual behavior
Test fails without trying to start the mongo container
How to Reproduce?
https://github.com/iompo/mongo-custom-test-resource
Output of
uname -a
orver
No response
Output of
java -version
OpenJDK Runtime Environment Temurin-11.0.16.1+1
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.4.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)gradle 8.1.1
Additional information
No response