-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Debugging underlying service code when using @QuarkusIntegrationTest? #28962
Comments
/cc @geoand |
|
I assume this is a property you set in the application.properties? |
Exactly |
I've added the following to my
When I now run the test it waits to attach debugger to port 5005. When I attach it, the test continues and I can debug through the test, however, when I do a post (using rest-assured), it doesn't stop at the breakpoint I set in the MyResource. I've also overridden the quarkus profile to use application-integration profile and when starting the test (from within Intellij) I can see it is started with integration profile (see startup command below: -Dquarkus.profile=integration), but it seems it picks up the properties from the This is the output when the test is started:
I have a test like this where I override
Then in MyResource class I have something like:
And the
Furthermore I have an
When I leave out the test.arg-line option from both I've tried adding info logging in |
One thing worth noting is that |
Oh, that changes things. Now I may have an idea why my test fails and cannot find the file location ;-) |
:) |
#24581 is the issue if want to chime in |
Although this issue was also more about being able to debug the application. I'm still not able to get into the underlying code. |
I just tried it and it works. Essentially if there the failsafe plugin is configured, then the integration tests will run and using
Attaching a remote debugging session to port |
OK, but when I have an integrationtest that posts something to my service and something goes wrong because of some misconfiguration. How will I be able to debug that? |
What I mentioned above will allow you to debug the application itself. If you need to debug the tests as well, then you'll need to run This means that you should then change |
I'm running the integrationtest from Intellij IDE in debug (not using mvn command line). That works fine and I can debug the test that way. In the prod The |
You will still need a remote debugging session for connecting to the application itself. |
Isn't that what I'm doing by setting the quarkus.test.arg-line in |
My point is that hitting |
OK, managed to get debugging working. Forgot to change port number in my initial configuration. |
👌🏼 |
And the reason for not coming into underlying sourcecode for one particular IT test I mentioned here: The test uses the resource path from the real class as follows:
In my integration test I did a post:
So I actually did a |
This seems not to be entirely true though. |
Description
Hi,
I have written unittests for my crud service which are annotated with
@QuarkusTest
. I can easily debug these from within Intellij. For some of these tests I have also written some mockservices using alternatives which are injected instead of the real services.I've also written some integrationtests, annotated with
@QuarkusIntegrationTest
. However, when I debug these from Intellij, I'm not able to debug the underlying code. I'm using restassured to post or get some messages and I can debug through the test, but not through the underlying service code itself. Is there a way to also debug the underlying code being called? I've put some system outs in the code, but I dont' see these being logged anywhere.I've also tried using
@QuarkusTest
for my integration tests, but then I run into problem again that the mocked services are being used instead of the real services; for my integration tests I want the real services to be used and not the mocks. I think using@QuarkusIntegrationTest
is also better to use, because it runs against the native code and we can use the native profile in our build process, which only triggers the integration tests after the native image has been build.Implementation ideas
No response
The text was updated successfully, but these errors were encountered: