-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduced mockito usage #2767
base: main
Are you sure you want to change the base?
Reduced mockito usage #2767
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2767 +/- ##
============================================
+ Coverage 84.99% 85.00% +0.01%
- Complexity 2734 2736 +2
============================================
Files 331 331
Lines 9559 9559
Branches 918 918
============================================
+ Hits 8125 8126 +1
Misses 1109 1109
+ Partials 325 324 -1 ☔ View full report in Codecov by Sentry. |
… reduce-mockito-usage-pass1
… reduce-mockito-usage-pass1
… reduce-mockito-usage-pass1
cucumber-core/src/test/java/io/cucumber/core/plugin/PluginsTest.java
Outdated
Show resolved
Hide resolved
… reduce-mockito-usage-pass1
I'm halfway through reviewing this. Made #2783 to reduce the size a bit. |
# Conflicts: # cucumber-guice/pom.xml # cucumber-java/pom.xml # cucumber-java8/pom.xml # cucumber-junit/pom.xml # cucumber-spring/pom.xml # cucumber-testng/pom.xml # datatable/pom.xml
I removed all mockito usages. I'm happy with the performance improvement on interactive tests, but a bit puzzled by having the same build duration with or without mockito when doing a maven clean+install. |
🤔 What's changed?
I reduced the usage of the Mockito framework. This is a first pass, focused on the simple cases (typically: replacing the mock+when constructs with stub classes).
⚡️ What's your motivation?
Fixes #2707 .
By focusing on the simple cases we have a big pull request of stuff that is simple to review. The other replacements are more complex and prone to more discussions, so I will make another pull request for them.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Performance when running all tests using Intellij (right click on project -> Run -> All Tests ; average duration over 5 runs):
Thus, when running tests interactively, we see a good improvement by not using mockito (up to 72% of testing time on cucumber-java).
However, over the full build (maven clean install on cucumber-jvm), there is no build time difference: on my machine, the build time is 1 minute 49 seconds on the
main
branch as well as on branchreduce-mockito-usage-pass1
(average build time over 5 builds).My guess is that the build time is much longer than the test duration, so the test duration on total maven clean+install is not noticeable.
📋 Checklist: