-
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
JPA test cleanup #37329
JPA test cleanup #37329
Conversation
🎊 PR Preview cd89658 has been successfully built and deployed to https://quarkus-pr-main-37329-preview.surge.sh/version/main/guides/ |
9ae1f95
to
81a2cce
Compare
All of this makes sense. Just remember you also need to adjust the JSON file with native tests if you move the IT modules around. |
4be58fe
to
861e286
Compare
@gsmet Thanks. I did not move the modules in the end, because I need to move to some other task. But I think this is a good first step and ready to merge :) About the review... Hum... good luck? More seriously, I'd recommend reviewing commit by commit, that way you can skip the larger diffs more easily. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There are a bunch of tests failing (at least on Windows):
|
This comment has been minimized.
This comment has been minimized.
Because: 1. We recommend that people use RestEasy Reactive, so we might as well take our own advice. 2. I've had enough with copy/pasted, manual exception handling ("reportException(...)"), especially since it's buggy (it doesn't take into account the fact that exceptions may have a null message, e.g. NPEs); 3. I don't want to deal with servlets on a daily basis, thank you very much.
1. Inject the entity manager and make use of the transaction-scoped entity manager proxy. 2. Use QuarkusTransaction instead of em.getTransaction() (which isn't even supposed to work in JTA environments...)
861e286
to
40e209b
Compare
Right, I forgot to run this particular module locally... Note I did run all the others, downloading all the DB container images just for this 😎 Anyway, I fixed the problems: should be good now. |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
Opening this draft so I don't forget about it.
Based on #36978 , which must be merged first.
For now this includes only this:
I had to do it anyway because I couldn't for the life of me debug test failures with this servlet stuff.
I wonder if I should also do the following:
createEntityManager
That will probably require adding a dedicated test using JPA's createEntityManager directly, so that we have at least some coverage for that?
@Transactional
orQuarkusTransaction
, instead ofentityManager.getTransaction()
That will probably require adding a dedicated test using
entityManager.getTransaction()
, so that we have at least some coverage for that?WDYT @gsmet / @Sanne?