-
Notifications
You must be signed in to change notification settings - Fork 6k
Parallelize Android unit tests #30728
Conversation
|
|
||
| @Config(manifest = Config.NONE) | ||
| @RunWith(RobolectricTestRunner.class) | ||
| @RunWith(AndroidJUnit4.class) |
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.
FlutterViewTest uses Shadow APIs of Robolectric, it's better to keep it using RobolectricTestRunner.
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.
These specific unit tests are passing in CI. what issue did you find? Robolectric's readme defaults to using AndroidJUnit4 https://github.com/robolectric/robolectric#usage
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 example doesn't use any shadow API of Robolectric. The tests use AndroidJUnit4 also can run on real Emulator/device, and shared with sharedTest pattern. If those tests will not run on real Emulator, it's fine to use AndroidJUnit4. If yes, we should avoid use shadow APIs for tests use AndroidJUnit4, or keep it to use RobolectricTestRunner for shadow APIs usage. I know there are some tests still use ShadowDisplay to control display rotation for tests.
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.
Oh, it's my fault. It uses Robolectric API. It's better to update it with ActivityScenario to lunch Activity, instead of current Robolectric.setupActivity in example. I will send a PR for it at Robolectric to discuss it.
|
@blasten Can you fix the conflict and land this please? |
|
Any updates on fixing the conflict? |
|
It might worth to introduce a label or something to denote that a PR has been deprioritized due to other higher priority work, so it can be skipped easily in PR triages? @chinmaygarde |
|
The WIP tag you added is the way to go. OTOH. If no work is likely, you could also just close it and reopen later if it ever gets prioritized. |
Helps flutter/flutter#96124
Parallelizes Android unit tests.
Summary: