quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

quarkus.datasource.devservices.port ignored during dockerized @QuarkusIntegrationTest #26192

Closed HerrDerb closed 2 years ago

HerrDerb commented 2 years ago

Describe the bug

When starting a @QuarkusIntegrationTest with quarkus.container-image.build=true and a dev service datasource, the property quarkus.datasource.devservices.port is ignored.

Expected behavior

When quarkus.datasource.devservices.port=5432 is set in application.properties, the db container should map to exposed port 5432.

Actual behavior

When quarkus.datasource.devservices.port=5432 is set in application.properties, the db container still maps to a random port

How to Reproduce?

No response

Output of uname -a or ver

MINGW64_NT-10.0-22000 *** 3.3.4-341.x86_64 2022-05-09 11:56 UTC x86_64 Msys

Output of java -version

openjdk version "17.0.3" 2022-04-19 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.9.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

gradle 7.4.2

Additional information

No response

quarkus-bot[bot] commented 2 years ago

/cc @geoand, @stuartwdouglas

geoand commented 2 years ago

I could not reproduce this, when I tried it the quarkus.datasource.devservices.port=5432 was used for all tests.

Here is how Quarkus was launching the container:

docker run --name quarkus-integration-test-MUNVY --rm -p 8081:8081 -p 8444:8444 --net=bf860611fd236ff0c26c790745a793b0c4f48bf2e4fefad6d834974462949e70 --env QUARKUS_HTTP_PORT=8081 --env QUARKUS_HTTP_SSL_PORT=8444 --env TEST_URL=http://localhost:8081 --env QUARKUS_DATASOURCE_PASSWORD=quarkus --env QUARKUS_DATASOURCE_DB_KIND=postgresql --env QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://postgres-7eSkV:5432/default?loggerLevel=OFF --env QUARKUS_DATASOURCE_USERNAME=quarkus --env QUARKUS_DATASOURCE_DEVSERVICES_PORT=5432 gandrian/hibernate-orm-quickstart:1.0.0-SNAPSHOT

Are you sure the port setting is being ignored? How are you determining this?

geoand commented 2 years ago

Closing this as never got feedback.