Open johnmanko opened 1 month ago
/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel)
I cannot reproduce this on my machine
@geoand Not even with the sample project I provided?
https://github.com/johnmanko/quarkus-redis-service-example
I made sure to quarkus update
, but it's still failing for me.
Yes, that's the project I tried
I cannot reproduce this on my machine
Neither can I reproduce. Tried on a mac, so needed to add -Dquarkus.native.container-build=true
so that native was built inside a linux container to be usable by the container that runs the native binary. My test output:
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.johnmanko.service.data.DataEndpointResourceIT
2024-06-03 15:26:46,881 INFO [org.tes.doc.DockerClientProviderStrategy] (build-4) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2024-06-03 15:26:47,041 INFO [org.tes.doc.DockerClientProviderStrategy] (build-4) Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2024-06-03 15:26:47,042 INFO [org.tes.DockerClientFactory] (build-4) Docker host IP address is localhost
2024-06-03 15:26:47,080 INFO [org.tes.DockerClientFactory] (build-4) Connected to docker:
Server Version: 4.9.3
API Version: 1.41
Operating System: fedora
Total Memory: 7360 MB
2024-06-03 15:26:47,088 INFO [org.tes.ima.PullPolicy] (build-4) Image pull policy will be performed by: DefaultPullPolicy()
2024-06-03 15:26:47,088 INFO [org.tes.uti.ImageNameSubstitutor] (build-4) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2024-06-03 15:26:47,091 INFO [org.tes.DockerClientFactory] (build-4) Checking the system...
2024-06-03 15:26:47,091 INFO [org.tes.DockerClientFactory] (build-4) ✔︎ Docker server version should be at least 1.6.0
2024-06-03 15:26:47,129 INFO [tc.doc.io/redis:7] (build-4) Creating container for image: docker.io/redis:7
2024-06-03 15:26:47,137 INFO [tc.tes.6.0] (build-4) Creating container for image: testcontainers/ryuk:0.6.0
2024-06-03 15:26:47,176 INFO [tc.tes.6.0] (build-4) Container testcontainers/ryuk:0.6.0 is starting: a19d15d4be2240b3d3f929d538e6dd88c6e82209622ec1a2e313ef4ab5e06aa8
2024-06-03 15:26:47,379 INFO [tc.tes.6.0] (build-4) Container testcontainers/ryuk:0.6.0 started in PT0.242079S
2024-06-03 15:26:47,404 INFO [tc.doc.io/redis:7] (build-4) Container docker.io/redis:7 is starting: 74686ab49d040f11430d9ffeeb1348eaf499e3fba535403600a0ab5d4ad668e7
2024-06-03 15:26:47,551 INFO [tc.doc.io/redis:7] (build-4) Container docker.io/redis:7 started in PT0.422237S
2024-06-03 15:26:47,551 INFO [io.qua.red.dep.cli.DevServicesRedisProcessor] (build-4) The <default> redis server is ready to accept connections on redis://redis-jpgf9:6379
2024-06-03 15:26:48,159 INFO [io.qua.tes.com.DefaultDockerContainerLauncher] (main) Executing "podman run --name quarkus-integration-test-BMefa -i --rm -p 8081:8081 -p 8444:8444 --net=c0f9b9f1b4e287986c69258db972694170f3291645737288c5f914bc43065e3e --env QUARKUS_LOG_CATEGORY__IO_QUARKUS__LEVEL=INFO --env QUARKUS_HTTP_PORT=8081 --env QUARKUS_HTTP_SSL_PORT=8444 --env TEST_URL=http://localhost:8081 --env QUARKUS_REDIS_HOSTS=redis://redis-jpgf9:6379 --env QUARKUS_CONTAINER_IMAGE_BUILD=true --env QUARKUS_NATIVE_CONTAINER_BUILD=true galder/quarkus-redis-service-example:1.0.0-SNAPSHOT"
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.249 s -- in com.johnmanko.service.data.DataEndpointResourceIT
[INFO] Running com.johnmanko.service.data.HelloEndpointResourceIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 s -- in com.johnmanko.service.data.HelloEndpointResourceIT
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
@johnmanko, according to:
2024-05-22 17:00:45,790 ERROR [org.tes.doc.DockerClientProviderStrategy] (main) Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
As no valid configuration was found, execution cannot continue.
See https://java.testcontainers.org/on_failure.html for more details.
There seems to be an issue with docker detection by TestContainers.
@zakkak / @galderz
The only thing that works for me is removing the extension container-image-docker
.
@johnmanko does it work without -Dnative
?
@johnmanko does it work without
-Dnative
?
I'll try when I'm back in the office next week. I forget off-hand which options (don't) work as expected.
Any update on this?
Any update on this?
I'll take a look at this tomorrow and get back to you. Thanks for the follow-up. I should have been more proactive. Sorry about that.
Describe the bug
I'm attempting to add integration tests to a project, but I can't get it when extension
container-image-docker
is installed.It errors with
Redis host not configured - you must either configure 'quarkus.redis.hosts
or 'quarkus.redis.host-provider-name' and have a bean providing the hosts programmatically.`Testing against the mock
@QuarkusTest
tests runs fine:./mvnw verify
Testing again integration
@QuarkusIntegrationTest
with plugincontainer-image-docker
runs:./mvnw verify -Dnative -Dquarkus.container-image.build=true
:Now, adding the following extension and rerunning the IT native tests:
Expected behavior
I would expect that a Redis instance would started and
quarkus.redis.hosts
set accordingly for the integration tests.Actual behavior
Is fails on ITs.
How to Reproduce?
Grab project with exact code/config I was testing with: https://github.com/johnmanko/quarkus-redis-service-example
Run:
./mvnw verify -Dnative -Dquarkus.container-image.build=true
Output of
uname -a
orver
6.5.0-35-generic
Output of
java -version
openjdk version "22-ea" 2024-03-19
Mandrel or GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.10.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.6
Additional information
No response