question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrating to JUnit 5

See original GitHub issue

I propose that we start migrating the test suite for Netty 5 (the master branch) to JUnit 5.

JUnit 5 is more expressive, extensible, and composable in many ways, and it’s better able to run tests in parallel. It can also directly run JUnit 4 tests, using the vintage engine, which means we can do this in small steps; there’s no need to migrate all tests all at once.

Once the JUnit 5 infrastructure is there, tests or modules can be migrated one by one, or be left as is for the time being. Regardless, new tests that are only added to the master branch can immediately use the new JUnit 5 test APIs.

Some benefits I anticipate are:

  1. Some tests will become easier to write, because JUnit 5 is more capable at expressing nesting of tests, and parameterisations.
  2. Builds should complete faster because JUnit 5 is better able to run tests in parallel. This is something that needs to be enabled explicitly, however, since it can cause latent test isolation failures to pop up.
  3. JUnit 5 is extensible enough that something like TimedOutTestsListener won’t need to live in the netty-build anymore.

A drawback I can think of is that forward porting changes to a JUnit 4 test in Netty 4.1, to a migrated JUnit 5 test in master, will be more challenging and add to the workload of doing changes in 4.1.

What do people think?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
kashikecommented, Jul 1, 2021
2reactions
kashikecommented, May 26, 2021

I hope that’s a good start for now! I have pushed all my progress so far, and I will probably pick up on this again later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from JUnit 4 to JUnit 5 - Baeldung
In this tutorial, we'll learn how to migrate from JUnit 4 to the latest JUnit 5 release, with an overview of the differences...
Read more >
Migrating From JUnit 4 to JUnit 5: A Definitive Guide
Key Migration Steps ; Replace testing classes and methods, Assertions and assumptions have been moved to new classes. Method argument order is ...
Read more >
Migrating from JUnit 4 to JUnit 5 | The IntelliJ IDEA Blog
The first thing we need to do in order to migrate to JUnit 5 is to add the JUnit 5 dependencies. We can...
Read more >
JUnit Migration Guide from JUnit 4 to JUnit 5 | by Wenqi Glantz
1. Add JUnit 5 pom dependencies · 2. Import package changed for popular annotations such as @Test · 3. No longer use @Test...
Read more >
Migrate to JUnit 5 from JUnit 4 - OpenRewrite
Migrate to JUnit 5 from JUnit 4 · In this tutorial, we'll use OpenRewrite to perform an automated migration from the venerable ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found