-
Notifications
You must be signed in to change notification settings - Fork 14
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
Remove Powermock and fix unit and functional tests #78
Remove Powermock and fix unit and functional tests #78
Conversation
...y/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityAndroidTestUtil.java
Outdated
Show resolved
Hide resolved
governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.adobe.marketing.mobile.edge.identity; |
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.
I have a proposal, should we write all our new files in kotlin? This util is written already and we should not rewrite this but do you guys think it is a good idea if we start writing all the new code/files in kotlin?
@prudrabhat @emdobrin @kevinlind
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.
It will help us write the files faster and also less boilerplate code especially for test helpers.
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.
During Core 2.0 development we found that writing new code in kotlin helped a great deal in improving code flow and and the amount of code written. Configuration and Signal were re-written in kotlin entirely!
...entity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityBootUpTest.java
Outdated
Show resolved
Hide resolved
...identity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityAdIdTest.java
Outdated
Show resolved
Hide resolved
.../src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityECIDHandlingTest.java
Outdated
Show resolved
Hide resolved
...rc/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityFunctionalTestUtil.java
Outdated
Show resolved
Hide resolved
...src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityResetHandlingTest.java
Outdated
Show resolved
Hide resolved
...ity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityPublicAPITest.java
Outdated
Show resolved
Hide resolved
...ty/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/ADBCountDownLatch.java
Show resolved
Hide resolved
...eidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/TestHelper.java
Show resolved
Hide resolved
code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/ECIDTests.java
Outdated
Show resolved
Hide resolved
.../edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityStateTests.java
Show resolved
Hide resolved
.../edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityStateTests.java
Show resolved
Hide resolved
.../edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityStateTests.java
Outdated
Show resolved
Hide resolved
.../edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityStateTests.java
Outdated
Show resolved
Hide resolved
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
public class IdentityFunctionalTestUtil { |
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.
This has been moved from edge.identity
to edge.identity.util
.
registerEdgeIdentityExtension()
and registerBothIdentityExtensions()
have been removed to use new registration logic via registerExtensions()
keeping the rest same.
...eidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/TestHelper.java
Show resolved
Hide resolved
...ty/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/ADBCountDownLatch.java
Show resolved
Hide resolved
...entity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityBootUpTest.java
Outdated
Show resolved
Hide resolved
.../src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityECIDHandlingTest.java
Outdated
Show resolved
Hide resolved
...rc/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityFunctionalTestUtil.java
Outdated
Show resolved
Hide resolved
.../edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityStateTests.java
Outdated
Show resolved
Hide resolved
...tity/src/sharedTestUtils/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java
Show resolved
Hide resolved
Arrays.asList( | ||
MonitorExtension.EXTENSION, | ||
Identity.EXTENSION, | ||
com.adobe.marketing.mobile.Identity.EXTENSION |
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.
I see this test is failing. We might need to check what is going on here.
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.
Ah. Looks like I missed adding a note for this in the description. This is a known regression (the same one that was discussed on slack) that we identified in Identity 2.0 extension (this is being fixed). I did verify that the tests pass with the patch fix that was made to Identity 2.0 . So once the fix is merged, a rerun is sufficient for this test.
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.
I see 👍. I missed this discussion.
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.
@cacheung The test failure will be addressed later.
...rc/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/IdentityTestConstants.java
Show resolved
Hide resolved
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.
lgtm!
We don't need sourceSets in build.gradle now after the restructure. |
We don't need static final String BOOTED = "com.adobe.eventSource.booted"; in constant file. |
The functional test on ci is failing? |
Added the reason here : #78 (comment) |
Thanks for catching this. It turns out that the deep copy method is no longer used. It was being used by the toMap(JSONObject) and toList(JSONObject) methods and now since they are being used from Core no usages are left. I removed deepcopy() and its tests entirely now. |
Codecov Report
@@ Coverage Diff @@
## dev-v2.0.0 #78 +/- ##
===============================================
+ Coverage 81.69% 93.33% +11.64%
===============================================
Files 20 12 -8
Lines 1027 675 -352
Branches 151 103 -48
===============================================
- Hits 839 630 -209
+ Misses 132 16 -116
+ Partials 56 29 -27
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
93% code coverage! Nice!
Description
Unit and functional test source updates have been deferred during the adoption of Core 2.0 changes to speed up the development and limit code review size. This PR adds the deferred test changes.
Test coverage is now 93%
Added and modified tests to be compatible with Core 2.0
Out of scope for this PR
Related Issue
MOB-17089
Motivation and Context
Unit and functional test source updates have been deferred during the adoption of Core 2.0 changes to speed up the development and limit code review size. This PR adds the deferred test changes.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: