-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.7.0.CR1: TestProfile + TestResource doesn't work in Native tests #11146
Comments
Thanks for reporting this. Actually the I have opened #11150 to explicitly prevent this usage. |
Thanks @geoand , then what's the strategy to test native builds with other needed components? Reuse the non native tests resources? |
Due to the long time it takes to build a native image, all native image tests must work with the same components. So the general idea is that if you need to have differentiated tests, those will only be for the JVM mode (i.e |
Ok but, what I asked is what could I use to start some containers to test native builds against. I thought about |
I understand the question, and the answer is the same 😉. You'll have to start up all components you need in a If you need to differentiate the components, the you can only do that with |
Ok thanks again. Last question, is true that everyting implementing |
And it looks weird, as having multiple |
No, that is not true. A class that implements
|
@geoand is this issue specific to 1.7.0.CR1 and considered a regression? It doesn't feel like it? |
It's a 1.6 issue, but with the advent of specific I suggest we do backport it because otherwise users end up in a situation where things seemingly should work, but they don't and there is absolutely no indication what's going on. |
Explicitly prevent the use of @testprofile with @NativeImageTest
Ok thanks very much. Unfortunately this issue #10225 still exist. I can't make native test working and populating DB using properties |
You are welcome |
I did and unfortunately I had to close that issue (with a proper reasoning, of course). |
Ah, a classic 🙃 |
@famod thanks very much for the info and that hibernate link. |
Describe the bug
As I wanted to separate native and "normal" tests, I made two TestProfiles, each of them have a custom TestResource with a MariaDB container (using testcontainers) on them. Each MariaDB has their own schema name etc (I changed it as I've seen native tests are using the same schema and container as normal tests) .
First issue came when I tried to set jdbc parameters for native tests in their own TestResource, it doesn't work.
Second issue, when setting them manually in "application.properties", it doesn't connect.
So, it looks like TestResources doesn't work on native tests. MariaDB container for native tests isn't used or started.
Expected behavior
Custom parameters set in TestResource for native tests are applied.
Custom TestResource for native tests are started and used.
Actual behavior
Neither parameters nor container is started in native tests.
To Reproduce
Steps to reproduce the behavior:
Unzip attached reproducer
quarkus_issue.zip
Execute ./mvnw clean verify -Dnative
Look native tests failing as it can't connect to native test resource, which is a testcontainer's Maria DB.
Configuration
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
uname -a
orver
: 5.4.0-42-genericjava -version
: openjdk version "11.0.8" 2020-07-14mvnw --version
orgradlew --version
): Apache Maven 3.6.3Additional context
I changed profile for generated native build, as I didn't want it to be default "prod".
The text was updated successfully, but these errors were encountered: