Comments (12)
Hi, my team and I are really interested on using this library!
Would be great to have the ability to run tests individually.
Please let me know if we can help
from testparameterinjector.
Correct me if I'm wrong, but Android Studio is backed by IntelliJ, right?
If so, this is a feature request that is on our radar. After some initial analysis, we believe the best fix for this is to update the IntelliJ JUnit4TestRunnerUtil.java.
from testparameterinjector.
@alexjski was working on this last time we spoke
from testparameterinjector.
According to IntelliJ, this should be fixed in their next release (2021.3)
from testparameterinjector.
https://youtrack.jetbrains.com/issue/IDEA-275586 is fixed in 213.2441 build. I also validated the version at head does not suffer from the problem anymore.
Thank you, @akozlova for fixing that!
from testparameterinjector.
Hi,
What tool are you using to run the single test?
from testparameterinjector.
I run it with the Android Studio option on each test for a kotlin app.
from testparameterinjector.
I sent a PR for Intellij which addresses the issue. The problem with that if it is merged, my understanding is that it will be made available in next intellij release, so until then (and users picking up the new version) the problem remains.
We could also apply a workaround on our side, however it is not possible to have parameter values filtered correctly with that. In fact, I believe such workaround would make it at least more complicated to reconcile with a proper fix on the IDE side. My preference would be to try to get the fix in for Intellij and just encourage users to update -- please let me know if that is not an acceptable solution.
from testparameterinjector.
Hi @alexjski, if by is not possible to have parameter values filtered correctly
you mean the individual test will run as many times as parameter values has, that would be totally ok for me 👍 Waiting for JetBrains + Android Studio to integrate the fix is gonna take a while.. Anyway, thanks for your help! Appreciate it
from testparameterinjector.
I use a temporary workaround for that:
as soon as someone wants to run a test method individually from AndroidStudio (IntelliJ IDEA) just comment out the line with @RunWith(TestParameterInjector::class)
and use only test class properties (not test method parameters) with annotation @TestParameter
and a default value for it.
;-)
You can put a comment about that restriction/workaround above the test class to help your colleagues with the approach.
from testparameterinjector.
Hi @alexjski, if by
is not possible to have parameter values filtered correctly
you mean the individual test will run as many times as parameter values has, that would be totally ok for me Waiting for JetBrains + Android Studio to integrate the fix is gonna take a while.. Anyway, thanks for your help! Appreciate it
The problem we are facing is that the test runner in Intellij creates an opaque Filter
which does not include the information about the parameter value, hence without the information, the best we can do is to run all combinations. I agree this is not the end of the world, but I wanted to test the ground about just getting that done in Intellij rather than adding a workaround internally and later deal with removing it.
The workaround is obvious -- run all combinations (in fact, I have a change lying around doing that exactly). The problem with it is that once Intellij does the right thing, then the workaround may hurt the usability and should eventually be removed (when?). This is why not creating a workaround internally is so tempting -- I hope that makes sense to you. I don't know if and when the PR for Intellij will be submitted and released -- if that was to happen soon, I would actually opt to say "please update your IDE". If it is the opposite/a lot of users must use older Intellij for a foreseeable future, that definitely changes the equation.
I think what I am hearing is that I should try a little harder (I may need to sacrifice some edge cases) to get the fix out quicker.
from testparameterinjector.
According to IntelliJ, this should be fixed in their next release (2021.3)
I tested that at head and the problem still prevails. Filed https://youtrack.jetbrains.com/issue/IDEA-275586 for it.
from testparameterinjector.
Related Issues (20)
- Build fails with firebase dependency HOT 3
- Support JUnit 5 HOT 27
- Support non-number floating point values HOT 2
- Support tests written in kotlin with parameter types that are `@JvmInline` value classes HOT 4
- Wrong transitive dependency protobuf HOT 3
- Feature request: shade protobuf dependency HOT 6
- Test naming changed from 1.8 to 1.9 for `float`s HOT 6
- JUnit 5: Support `@Nested` classes HOT 5
- Run in Firebase Test Lab HOT 2
- Feature request: Expose `PluggableTestRunner` HOT 2
- Trying to run the test but nothing happened
- How to be inject parameter into the test class constructor HOT 2
- How to set custom name for `@TestParameter` HOT 2
- Running a single test using maven verify HOT 2
- Does this work with Powermock libraries? HOT 12
- test execution time is not accurate HOT 10
- Non-static method support for dynamic parameter generation HOT 10
- Consider keeping a changelog? HOT 1
- Can't use more than one `TestParameter` annotation with Android Instrumentation tests. HOT 8
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 testparameterinjector.