1000kit / tkit-quarkus

1000kit quarkus extension
https://github.com/1000kit/tkit-quarkus
Apache License 2.0
1 stars 2 forks source link

0.19 test-db-import NPE when running tests after the first time in quarkus dev mode #98

Closed chrispysz closed 8 months ago

chrispysz commented 12 months ago

Quarkus version: 2.16.9.Final

Steps to reproduce:

  1. Clone this small example project or setup a new one only with hibernate, pg-jdbc, resteasy and db-import extensions https://github.com/chrispysz/quarkus2-playground

  2. Run mvn quarkus:dev

  3. Press "r" (test should pass)

  4. Press "r" again (test fails)

2023-10-27 12:34:02,055 ERROR [io.qua.test] (Test runner thread) Test GreetingResourceTest#testHelloEndpoint() failed : java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step org.tkit.quarkus.test.dbimport.DevServicesDbImportProcessor#startDbImportDevService threw an exception: java.lang.NullPointerException: Cannot invoke "io.quarkus.datasource.deployment.spi.DevServicesDatasourceResultBuildItem.getDefaultDatasource()" because "devServiceDatasource" is null at org.tkit.quarkus.test.dbimport.DevServicesDbImportProcessor.startDbImportDevService(DevServicesDbImportProcessor.java:51)

andrejpetras commented 8 months ago

Hi @chrispysz, thank you for reporting this issue.

The current implementation does not support reusable data source dev-services. https://quarkus.io/guides/databases-dev-services#reuse

You can disable it.

quarkus.datasource.devservices.reuse=false

The disadvantage is that Quarkus starts the new database container every time the tests are repeated.

andrejpetras commented 8 months ago

Fix in release version 2.13.0.