Comments (10)
Can you replicate this issue in a minimal example and share that example, please?
from testparameterinjector.
the test project is running against our internal spring context /bean app , it is very hard to have a simple example.
we found 3-4 mins increase for first test method in Junit test xml , does testparameterinjector overwrite the way calculating test execution time ?
from testparameterinjector.
does testparameterinjector overwrite the way calculating test execution time ?
Not that I know
from testparameterinjector.
we add time stamp on before/after method , execution time is not different , but execution time from junit report has increased a lot .
from testparameterinjector.
I take a quick look on PluggableTestRunner ,
getTestMethodProcessors().postProcessTestInstance(testInstance, testInfo);
I think this method would take a longer time to process at the first time , considering there are multiple inherence in test class , and each test class have spring beans such as
@Autowired
private TestA testa;
......
@Autowired
private TestB testb;
It would be slow at beginning when going through on parent classes from java reflection .
from testparameterinjector.
What would you suggest to fix this?
from testparameterinjector.
Maybe we could exclude parsing /scan effort as part of test case execution itself , that cause confusion .
Also , it looks like PluggableTestRunner is running postProcessTestInstance/scan on every test method which is ver heavy.
Not sure how JUnitParamsRunner handle this .
from testparameterinjector.
One more suggestion is maybe we need move parse/scan out of methodBlock , otherwise Junit treats that as part of method execution time.
Ideally , we need parse/scan/inject before test class start .
from testparameterinjector.
So if I understand you correctly, this is more about the confusing timings reported by JUnit than it is about the actual slowness?
I do wonder why it is so slow for you though. Do you have many test methods? I'd think that the @Autowired
stuff gets done after the TestParameterInjector stuff. It would really be helpful if you have a minimal test that you can share that reproduces this issue, so that I can investigate where all the time is being spent. There is definitely a lot of work that's happening multiple times that could be cached if the need arises.
About the time reporting: I had a look at JUnitParamsRunner, and they seem to be interfacing with JUnit in a completely different way, and it's a bit hard to see which one is best.
If you have a proof of concept of what we could do differently, I'm happy to run it against all Google tests and see if it works.
from testparameterinjector.
yes, you are right , sorry for confusion , that is not slowness actually , I changed title just now .
Our test classes are inherence from many layers, each layer is spring context with huge @Autowired , there are around 10000 test class/context need to be initialized, it takes 3-4 mins , we compared between JUnitParamsRunner and testparameterinjector , that initialization time is same , only difference is , JUnitParamsRunner trigger initialization before test class start while for testparameterinjector , it happens after test class start .
I think JUnitParamsRunner handle different way as yours for sure .
We will take a look and ping you back once we have good solution .
Thanks for help and support !!!
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
- Non-static method support for dynamic parameter generation HOT 10
- Run a single test in IntelliJ HOT 12
- 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.