Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My original idea was to make another totally unrelated change.
But I saw I could not run most test without installing every engine manually, and I
didn't like the idea.
I found this wonderful project TestContainers, used for other persistence libraries.
Basically it automatically starts and stops an instance of a docker virtual machine
with whatever database you need. I'm not docker-savvy, but it worked with docker for windows,
instructions were pretty clear and so I give it a try. And it worked.
You still need to install docker (for windows if that's your OS), but it's waaaay less work than
installing 5 database engines.
The first time a test for a specific database runs it need to download the full image
and that make take some time, but after that it reuses the same image and they are pretty fast.
161 tests run in 300 seconds on my laptop
What I did:
I migrated all tests to junit4, since is the minimal version supported by testContainers
I separated the tests in 3 categories
because I couldn't make it work.
You can choose what category to run from command line, I wrote the instructions in the readme.md file.
I refactored the tests one by one, using TestContainers docker based databased and most test worked after a few changes
The changes
linux (like docker images) are case sensitive. I edited your script for creating tables for MySql, basically making
all tables names PascalCase.
them on every test method.
Finally I don't know If I broke oracle, I find no way to test it.
I think there is still room for improvement:
specific tests for the non-standard dataypes?
message. I think I'm killing my machine by starting/stopping multiple database engines, but maybe there is something else.
Anyway, let me know what you think, and please try in you machine!
PS:
Persism.iml files, and the whole folders .idea and target should be included in .gitignore. There are not needed because
idea regenerated them on demand, and are filesystem dependent. I didn't change them because I didn't want to
make more changes in the PR.
Again, let me know what you think!