-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Steps to reproduce
Run any test suite that includes a Robolectric test on a module with JUnit 6.
This is normal setup, Android library modules usually have
- Jupiter 5/6 applied for writing unit tests, and
- Vintage engine applied for discovering Robolectric tests using runner/rules

Context
- Used versions (Jupiter/Vintage/Platform): 6.0.0
- Build Tool/IDE: Android Studio Narwhal (2025.1.3)
The Android world is lagging behind, and Jupiter 5+ first party support is practically non-existent and based on these won't be a thing for years to come.
- https://developer.android.com/training/testing/local-tests
- Real JUnit 5 support (via extension API) robolectric/robolectric#3477
- JUnit 5 support android/android-test#224
There's some community effort, but it's very experimental.
So I would like to kindly ask for a way to silence this deprecation, so we're not reminded of Google's inaction with a big red warning every day we write tests.
References:
- Migration docs we can't apply to Android
Lines 50 to 54 in cee1471
var issue = DiscoveryIssue.create(DiscoveryIssue.Severity.INFO, // "The JUnit Vintage engine is deprecated and should only be " // + "used temporarily while migrating tests to JUnit Jupiter or another testing " // + "framework with native JUnit Platform support."); discoveryRequest.getDiscoveryListener().issueEncountered(uniqueId, issue);
Workarounds
Downgrade to JUnit 5
Of course we could stick with JUnit 5, but I (and hopefully others too) would like to follow improvements and fixes made in JUnit 6.
Increase the log level to warning
I'm not sure how to do it, looked at Discovery issues, but all I can figure out is how to stricten the tests with junit.platform.discovery.issue.severity.critical
.
Related Issues
Deliverables
- An opt-out property.
- Automatic detection of Robolectric/Android would be ideal.