-
Notifications
You must be signed in to change notification settings - Fork 989
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
NT-1735: Target API 30 🚀 #1240
NT-1735: Target API 30 🚀 #1240
Conversation
This reverts commit 444d1b6.
9a36b18
to
38b5bf9
Compare
Codecov Report
@@ Coverage Diff @@
## master #1240 +/- ##
============================================
- Coverage 74.85% 74.69% -0.16%
+ Complexity 738 734 -4
============================================
Files 221 221
Lines 6645 6656 +11
Branches 402 402
============================================
- Hits 4974 4972 -2
- Misses 1538 1551 +13
Partials 133 133
Continue to review full report at Codecov.
|
@@ -49,7 +51,13 @@ abstract class KSRobolectricTestCase : TestCase() { | |||
.applicationModule(TestApplicationModule(application())) | |||
.build() | |||
|
|||
val config = ConfigFactory.config().toBuilder() |
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.
nice!
@@ -23,13 +23,13 @@ | |||
@Before | |||
public void setUp() { | |||
RxAndroidPlugins.getInstance().reset(); | |||
ShadowLooper.pauseMainLooper(); | |||
//ShadowLooper.pauseLooper(Looper.myLooper()); |
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.
delete this two lines please
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.
Done 👍🏽
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.
Great work here @leighdouglas!
@@ -94,6 +96,7 @@ class BackingFragmentViewModelTest : KSRobolectricTestCase() { | |||
this.vm.outputs.projectDataAndAddOns().subscribe(this.listAddOns) | |||
this.vm.outputs.bonusSupport().map { it.toString() }.subscribe(this.bonusAmount) | |||
this.vm.outputs.deliveryDisclaimerSectionIsGone().subscribe(this.disclaimerSectionIsGone) | |||
Shadows.shadowOf(Looper.getMainLooper()).idle() |
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 think these Shadows.shadowOf(Looper.getMainLooper()).idle()
are no longer necessary as you found the root cause if blocking problem
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.
Okay i can remove them and see if it passes CI
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.
Done, and everything passed CI! 🎉 🚀
📲 What
Upgrading to Android API 30 requires a few updates for our codebase to be compatible. I have added a queries element to the Android manifest file for the new package visibility requirements in API 30. Also updated tests to reflect new formatting changes.
ObserveForUITransformerTest
suite (more on that below)🛠 How
More context on
ObserveForUITransformerTest
-> Robolectric 4.4 was a massive update that included changes to their shadow looper. These changes are causing mysterious test failures during thetearDown()
that happens after the test is run, specifically it is throwing anjava.lang.UnsupportedOperationException: main looper cannot be unpaused
exception. After exhausting a few solutions from their documentation (they have a whole article about it here-> http://robolectric.org/blog/2019/06/04/paused-looper/), and since all of this code is about 5 years old, @jgsamudio and I decided to remove these lines since the tests are passing without them. Perhaps robolectric is not performing these operations for us under the hood.For the jacoco config to exclude generating coverage for jvm internal classes, this is a known issue and related to our target jvm being 1.8. See -> gradle/gradle#5184
👀 See
No UI changes
📋 QA
Since these are all internal changes and not user facing, I would test this by opening the app and making sure nothing is crashing.
Story 📖
[SPIKE] Fix Test Environment for Android 11 Migration
[Spike]Android 11: Target API 30