[Bug]: No tests found with JUnit 5.9.0
See original GitHub issueModule
Core
Testcontainers version
1.17.3
Using the latest Testcontainers version?
Yes
Host OS
Any OS
Host Arch
Any arch
Docker version
Client: Docker Engine - Community
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:02:57 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:01:03 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.7
GitCommit: 0197261a30bf81f1ee8e6a4dd2dea0ef95d67ccb
runc:
Version: 1.1.3
GitCommit: v1.1.3-0-g6724737
docker-init:
Version: 0.19.0
GitCommit: de40ad0
What happened?
Any tests annotated with @TestContainers not found by Maven Surefire plugin 2.22.0 with JUnit 5.9.0.
All works fine with JUnit 5.8.2.
Relevant log output
No response
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Eclipse No tests found using JUnit 5 caused by ...
Whenever I run my projects JUnit test (using JUnit 5 with Java 9 and Eclipse Oxygen 1.a) I encounter the problem that eclipse...
Read more >Can't find tests (JUnit 5) – IDEs Support (IntelliJ Platform)
When I attempt to run an entire folder of unit tests, I am told that "No tests were found". I am told that...
Read more >JUnit 5 Release Notes
version 5.9.0-RC1 ... Bug Fixes; Deprecations and Breaking Changes ... This will fail the suite if no tests are discovered.
Read more >JUnit Test' or 'No tests found with test runner JUnit5' - Bugs
Indeed, when using JUnit 5.5.2 this bug seems to be fixed. Fortunately I was able to update my project to Spring Boot 2.2.1.RELEASE...
Read more >Maven Surefire Plugin – Using JUnit 5 Platform
You can find integration tests with JUnit4/5, with JUnit5/TestNG and ... You may want to update the version of engine with fixed bugs...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey @ilgrosso, thanks for your detailed triaging. You are completely right, this is an issue with
org.testcontainers.junit-jupiterbringing in the transitiveorg.junit.jupiter:junit-jupiter-api:jar:5.8.2dependency.So either there might be a better way to build our junit-jupiter extension here (we would need to check on best practices around extensions in the community), or we just update the dependency itself (although this does not seem like the clean solution to me).
Thanks @kiview for the nice example. Taking inspiration from it, I reworked how JUnit artifacts are included, in order to avoid using the
apiconfiguration, see #5985.