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.

[Bug]: No tests found with JUnit 5.9.0

See original GitHub issue

Module

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:open
  • Created a year ago
  • Reactions:1
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
kiviewcommented, Aug 9, 2022

Hey @ilgrosso, thanks for your detailed triaging. You are completely right, this is an issue with org.testcontainers.junit-jupiter bringing in the transitive org.junit.jupiter:junit-jupiter-api:jar:5.8.2 dependency.

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).

1reaction
edyslicommented, Oct 11, 2022

Thanks @kiview for the nice example. Taking inspiration from it, I reworked how JUnit artifacts are included, in order to avoid using the api configuration, see #5985.

Read more comments on GitHub >

github_iconTop 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 >

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