snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

@QuarkusIntegrationTest with docker image fails on unable to create logfile #351

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

When running an integration test with the new @QuarkusIntegrationTest annotation against a compiled docker image, it will redirect the output to a logfile which resides in a folder that does not exists. Only option to currently is to create the folder before the tests are run (using (static) initializer or QuarkusTestResourceLifecycleManager).

The log file is set here: https://github.com/quarkusio/quarkus/blob/fdf16ebc9728d0a0421202ba6f5f27351e095d09/test-framework/common/src/main/java/io/quarkus/test/common/DockerContainerLauncher.java#L93

The method getLogFilePath doesn't make much sense, since: https://github.com/quarkusio/quarkus/blob/c2801d4f5215281025552f213babfcf7e3591eae/test-framework/common/src/main/java/io/quarkus/test/common/PropertyTestUtil.java#L33 will always contain two parts: target and the value of quarkus.log.file.path which defauls to quarkus.log.

So, using default settings it will try to access the file target/quarkus.log, but the working directory is the target folder, so it actually tries to write to target/target/quarkus.log, which doesn't exists and fails.

Also settings custom paths for quarkus.log.file.path gives an error because target/ is prepended.


https://github.com/quarkusio/quarkus/issues/17565


$upstream:17565$