snowdrop-zen / quarkus

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

Wrong error message: If QuarkusTest has wrong working directory, it should not blame it on "NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image" #367

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

To reproduce with quarkus 1.13.3.Final (I haven't tried 2.0 yet):

  1. git clone https://github.com/kiegroup/optaplanner-quickstarts
  2. Open that project in IntelliJ
  3. In the module quarkus-school-timetabling, open the class TimeTableConstraintProviderTest and run it by clicking on the run icon in the gutter of the java file editor at the class declaration line.

Notice that the working directory of the run configuration that IntelliJ gives you by default will be set to "optaplanner-quickstarts" and not "quarkus-school-timetabling". When it's set incorrectly like that, the unit test fails with this error:

java.lang.RuntimeException: java.lang.RuntimeException: java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image

    at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:674)
...
Caused by: java.lang.RuntimeException: java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image
...
 Caused by: java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image

To a user, that error message should instead say "your working directory is wrong", so we can fix it and move on.

Here's how to fix it in the run configuration of intellij (which sets the working dir to quarkus-school-timetabling):

Selection_723


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


$upstream:18132$