-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Upgrade mockito #7577
Upgrade mockito #7577
Conversation
@blueorangutan package |
@harikrishna-patnala a [SF] Jenkins job has been kicked to build packages. It will be bundled with |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6193 |
Codecov Report
@@ Coverage Diff @@
## main #7577 +/- ##
=========================================
Coverage 12.96% 12.96%
- Complexity 8998 8999 +1
=========================================
Files 2728 2728
Lines 256667 256667
Branches 40028 40028
=========================================
+ Hits 33276 33282 +6
+ Misses 219210 219205 -5
+ Partials 4181 4180 -1 see 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -113,7 +113,7 @@ | |||
<cs.junit.dataprovider.version>1.13.1</cs.junit.dataprovider.version> | |||
<cs.junit.jupiter.version>5.9.1</cs.junit.jupiter.version> | |||
<cs.guava-testlib.version>18.0</cs.guava-testlib.version> | |||
<cs.mockito.version>3.2.4</cs.mockito.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may also need the following change, so mockstatic() can be used with Mockito itself.
- <artifactId>mockito-core</artifactId>
+ <artifactId>mockito-inline</artifactId>
Let's first run tests and see nothing is broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harikrishna-patnala tests have been run in the github acrions. Do you need to see anything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harikrishna-patnala Let me make this change. Then we can incrementally remove PowerMockito.
d87c62a
to
54bc93a
Compare
54bc93a
to
9c55900
Compare
utils/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
Show resolved
Hide resolved
utils/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
Show resolved
Hide resolved
9c55900
to
f02f0bf
Compare
f02f0bf
to
5530db9
Compare
…ns.MockMaker from rat
ddae741
to
99afb91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
@@ -0,0 +1 @@ | |||
mock-maker-inline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vishesh92 is this boilerplate or does it serve any purpose? If you want an empty file you can touch the file and git add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to add this file to module when we remove powermock. It specifies the MockMaker to use in that module for running tests.
more info here: https://github.com/apache/cloudstack/pull/7577/files#r1217685958
@blueorangutan package |
@rohityadavcloud a [LL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [LL]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6099 |
Description
This PR upgrades the mockito version and removes powermockito from
utils
module.Moving to Mockito to mock static methods (available since 3.4.0) instead of powermockito since it hasn't had any release since 2020 and is not compatible with newer versions of mockito.
I will create separate PRs for other modules overtime and eventually remove powermockito.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?