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
Adds JUnit 5 test support #3322
Conversation
rerunning tests as in travis all tests failed. |
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, now lets convince travis
@dizzzz I got some trouble getting the problem that travis seems to have while building... :-( |
appveyor and travis are consistent, interestingly:
|
https://www.baeldung.com/junit-5-migration <dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit5.vintage.version}</version>
<scope>test</scope>
</dependency> is missing for the sub-pomfiles? (sorry for closing) |
I took a look into this PR this morning and tried a few things. Unfortunately it is not a straight-forward thing to move eXist-db to Junit 5, for three reasons:
Now obviously this can all be solved given enough time and resource, but it is going to be quite involved I think. Also, I wonder if now is the right time to move to JUnit 5, as some of the APIs we want to use e.g. parallelism, are marked as experimental. I am happy for @reinhapa and others to take this forward if they still want to, but personally I probably would not have much time to offer for this as I guess I don't yet see what the benefit of doing so would be? |
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.
see Adams remarks :-(
@adamretter the goal of this PR is not the migration of the existing test to the JUnit 5 API . I should enable to use write JUnit 5 tests in addition to the existing ones.
As my existing experience in other project shows,is that there the existing tests can be run using the JUnit Vintage test engine as stated in the migration guide.
I would suggest to leave the existing tests as they are, until we get the tools running also as JUnit 5 test. I will take a look into this task as soon as we have migrated the test execution to the new JUnit test engines though.
Here the same approach applies as the existing JUnit tests.
In my opinion this a good time to do so and may give those experimental parts a try and help the JUnit team to improve there code too.
From my part I'm happy if I get some support according the build infrastructure and the way to run the build locally in a way that matches the build environment in order to capture the build failures locally. |
@reinhapa Okay... I understand the scope. What I don't understand is how we can have JUnit4 tests which have a dependency on JUnit 4 jar files (especially the JUnit4 runner), run on the JUnit4 engine (even with the vintage dependency). |
@adamretter the existing JUnit 4 test still need the existing JUnit 4 dependency the execution is done with using the JUnit Vintage test engine dependency, which is a one test engine implementation of the JUnit 5 platform (https://junit.org/junit5/docs/current/user-guide/#overview-what-is-junit-5) We could implement our own test engine for our XML tests not using any other API than the test engine API itself |
Opened an issue for the current error on junit-team/junit |
All 4 linux builds failed on Travis (only the macOS build succeeded) - restarted one linux build to test the waters. |
3b0f475
to
03fead0
Compare
58ac2f9
to
cd8f2d8
Compare
3db5cb5
to
7bff31b
Compare
52c7c42
to
19c3053
Compare
} | ||
} else { | ||
try { | ||
embeddedServer.restart(); |
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.
This seems like every call to getBrokerPool() will restart the database. This seems like it would be very expensive.
Is it that this method is not really named correctly, or that we don't want to restart the database on every getBrokerPool call?
I need to understand this a bit better...
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.
I can do a try leaving this away...
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.
Seem that when letting this away it leads to non available security manager service though..
aa76a7f
to
19daf2d
Compare
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.
Rebase required, after pulling in Adams last PR (which needs to be rebased)
@@ -72,6 +71,6 @@ public Description getDescription() { | |||
}; | |||
|
|||
final RunNotifier notifier = new RunNotifier(); | |||
runner.run(notifier); | |||
assertDoesNotThrow(() -> runner.run(notifier)); |
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.
nice :-)
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.
Looks great! Only one compile/test/... scope question
Signed-off-by: Patrick Reinhart <patrick@reini.net>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Implements the #3321 feature.