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
Migrate to JUnit5 #545
Comments
Move tests to JUnit5 Fixes etcd-io#545
@fanminshi @lburgazzoli I've migrated tests to JUnit5 in #547 A few notes:
Given absence of global timeout support and that we would have to keep junit dependency anyway to support What do you think? |
Move tests to JUnit5 Fixes etcd-io#545
This is a long shot, but by any chance would @marcphilipp mind taking a look at this and help point us in the right direction? You've been super helpful with junit info elsewhere (e.g. in the gradle repo) so I figured I'd give it a whirl here too. Thanks much. |
I wrote the those unit tests way before we had the test-container capability. I think in the future, we can just write integration tests. I don't see too much utility of writing unit tests beside using a stub grpc server to return specific errors. I think those can be removed.
Overall, our integration tests should complete in a reasonable time. I can see the test level timeout in debugging hanging tests. However, I don't think that's a strict requirement. I think it is fine we can remove the restriction on test timeout for now until junit5 add those feature. Then we can revisit this problem. |
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
It should be stateless because the same extension instance might be used concurrently when using parallel execution for different test methods or even classes (if the extension is registered globally). Thus, I'd recommend storing state in the store. There's a bit of a learning curve to it, let me know if you have questions. If we can improve the docs based on your feedback, that'd be great.
Test-level timeouts are on the agenda for JUnit 5.5. @dbyron0 Please let me know how I can help. 🙂 |
@marcphilipp does it mean that this implementation is incorrect even if it's used with Thanks for letting us know about timeouts! |
It will work as long as you don't use |
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Move tests to JUnit5 Fixes etcd-io#545
Thank you @marcphilipp ! |
Hi @dbyron0, @marcphilipp. We have a JUnit4 Now we're going to migrate it to an So the question is: does this way of usage of an extension requires making it stateless? The paragraph https://junit.org/junit5/docs/current/user-guide/#extensions-keeping-state mentions need to use the Also it mentions Thanks in advance for clarifying this! |
It's still a good practice to manage state via |
Thanks for clarification @marcphilipp! |
Update all tests to use JUnit5 instead of JUnit4 based on discussion in #506.
At least two things would have to be done:
ExternalResource
The text was updated successfully, but these errors were encountered: