Migrating to JUnit 5
See original GitHub issueI 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:
- Some tests will become easier to write, because JUnit 5 is more capable at expressing nesting of tests, and parameterisations.
- 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.
- JUnit 5 is extensible enough that something like
TimedOutTestsListener
won’t need to live in thenetty-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:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
all
- no testsbom
- no testsbuffer
- #11305codec
- #11306codec-dns
- #11307codec-haproxy
- #11308codec-http
- #11316codec-http2
- #11422codec-memcache
- #11310codec-mqtt
codec-redis
- #11318codec-smtp
- #11309codec-socks
- #11314codec-stomp
- #11312codec-xml
- #11311common
- #11319dev-tools
- no testsexample
- no testshandler
handler-proxy
- #11313microbench
- #11443resolver
resolver-dns
- #11326resolver-dns-native-macos
tarball
- no teststestsuite
- #11320testsuite-autobahn
- no teststestsuite-http2
- no teststestsuite-native
testsuite-native-image
- no teststestsuite-native-image-client
- no teststestsuite-native-image-client-runtime-init
- no teststestsuite-osgi
- https://github.com/ops4j/org.ops4j.pax.exam2/issues/951testsuite-shading
- #11323transport
- #11315transport-blockhound-tests
- #11322transport-native-epoll
- #11320 #11442transport-native-kqueue
- #11320transport-native-unix-common
- #11321transport-native-unix-common-tests
- #11320transport-sctp
- #11325I 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.