Comments (5)
I can reproduce the issue here, and it's tied to the android-junit5-embedded-runtime
dependency. It seems like overriding the JUnit 5 Runtime causes an incompatibility with the way Android Studio 2.x is hooking into the launch process, most likely due to renamed internal APIs.
You can see that the method doesn't even exist anymore inside IdeaTestRunner.java
. I guess it would be necessary to override more of the standard JUnit runtime classes to make this work, however that might break other internals of AS (the embedded runtime is a dirty hack as it is already…).
I'm afraid that you are going to need to run your unit tests from Gradle directly (./gradlew junitPlatformTest
works just fine), at least for the time being, or switch to the AS 3.x Beta. I'll extend the info in the README to explicitly state this incompatibility though.
from android-junit5.
Actually, let me keep this open & experiment a little with including more IntelliJ JARs into the embedded runtime. I'll keep you posted! Might be a few days, though.
from android-junit5.
@mannodermaus, thanks! Currently I can't migrate to AS 3 beta for this project until AS is in final version. But it will be soon as we know Android team is working hard. So, maybe just try, but don't spend so much time on it. I will stick with JUnit4 for a while.
from android-junit5.
@mannodermaus, I tried with AS 3 beta7, but the embedded-runtime
library is still necessary. However, there it works.
from android-junit5.
Yes, even the latest Beta of Android Studio 3 isn't "up-to-date enough" with IntelliJ's master branch to fix the incompatibility issue present in older versions, so the embedded-runtime
is required there as well. As for Android Studio 2, I haven't managed to replace the JUnitStarter
responsible for accessing the removed setStreams
method in the same way, so I'm afraid that launching JUnit 5 tests from the IDE directly isn't going to work with AS 2. I'll update the Readme and attach a notice there. Again, running the Gradle task directly still works, of course.
Thanks for making me aware of this!
from android-junit5.
Related Issues (20)
- Instrumented Testsuites run on JUnit4 Runner HOT 1
- Might be better to migrate CI to Github Actions
- Add support for Gradle Plugins DSL HOT 2
- org.junit.runners.model.InvalidTestClassError starting with Android Studio Dolphin | 2021.3.1 HOT 8
- Build broken when using kotlin 1.7.21 HOT 1
- Clarification with regards to JaCoCo HOT 2
- AGP 8.0.0-alpha10 HOT 6
- Various 'Unable to resolve' log messages for Android tests HOT 4
- Parallel concurrent execution of instrumentation tests HOT 6
- NoClassDefFoundError: org/jetbrains/kotlin/gradle/plugin/KotlinPluginKt with Kotlin 1.8.20 HOT 5
- `@Tag` at the class level results in test number mismatch HOT 6
- NoSuchMethodError: 'org.gradle.api.provider.Property org.gradle.api.reporting.ConfigurableReport.getOutputLocation()' on Gradle 7.5.1 HOT 3
- Is it possible to run junit5 tests with robolectric? HOT 5
- Encountering problems when trying to integrate the plugin HOT 1
- Log not working with ParameterizedTest HOT 1
- Support per-test log display for JUnit 5 instrumentation tests HOT 4
- Readme should include apply plugin for legacy syntax HOT 1
- "Expected N+1 tests, received N" caused by fun with @TestTemplate HOT 4
- Invalid test names for repeated and parametrized tests HOT 8
- Usage of ComposeExtension flags a false-positive warning in newer IDEs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-junit5.