-
Notifications
You must be signed in to change notification settings - Fork 2.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
test(e2e): detect redbox in ci #5233
Conversation
Access to the collection of TaskExecutors wasn't correctly synchronized in all places Fixes #5225
previously they were the ugliest, my fault
This correctly identifies that #5225 can happen, where previously it passed CI with no problem. Tested by applying / removing the fix for 5225 and now CI will fail if a redbox ever happens again
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/invertase/react-native-firebase/Fx1cyaqi6wnoMFJBD2jGapfEJ6Y6 |
Pre-flake - working on a view matcher test and battling this:
May be related to a few things recommended to add @Before
public void unlockScreen() {
final TaskCreateActivity activity = activityRule.getActivity();
Runnable wakeUpDevice = new Runnable() {
public void run() {
activity.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
};
activity.runOnUiThread(wakeUpDevice);
} to Activity for test |
Codecov Report
@@ Coverage Diff @@
## master #5233 +/- ##
==========================================
- Coverage 88.86% 85.26% -3.60%
==========================================
Files 109 109
Lines 3743 3743
Branches 360 360
==========================================
- Hits 3326 3191 -135
- Misses 370 481 +111
- Partials 47 71 +24 |
Also maybe https://github.com/linkedin/test-butler for techniques, but that won't work on Google APIs emulator images (which we require for firebase) |
I think this is unworkable here. May take the idea to jet-next. It's really hard to do 🤷 |
Description
Attempt to verify after each test that the main app is still displaying, to make sure we don't have a redbox in place or similar
This is a WIP at the moment as it has E2E flakiness noted below, but I have it working locally so I wanted to make sure it was at least posted on github just in case.
Related issues
Related - #5225 - issue generated a redbox and CI is blind to redboxes
Release Summary
Conventional commits - rebase merge
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
The whole PR is a test. That said, you should have a test that triggers a redbox to verify redbox detection is working
Note that right now this is flaky on CI, unknown reasons why but it appears to be that the heuristic-based Espresso Root View detector (used by Detox under the covers to do layout matching and determine main app visibility) is sometimes picking the wrong RootView so we aren't matching against the app layout. It's possible the screen is locked or that there is an ANR or welcome dialog or similar confusing it.
Related information:
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter