tests: use Detox as compile reference, ignore UIManager queues (#4076)

This commit is contained in:
Mike Hardy
2020-08-13 02:57:41 -05:00
committed by GitHub
parent 70305ef0f9
commit c91d2ffe39
4 changed files with 36 additions and 13 deletions

View File

@@ -1,15 +1,8 @@
// Add the Firebase Crashlytics plugin.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: "com.google.firebase.firebase-perf"
import com.android.build.OutputFile
project.ext.react = [
@@ -140,7 +133,7 @@ dependencies {
/* ------------------------
* TESTING SDKS/LIBRARIES
* ------------------------ */
androidTestImplementation('com.wix:detox:+')
androidTestImplementation(project(path: ":detox"))
}
// Run this once to be able to run the application with BUCK

View File

@@ -29,10 +29,10 @@ allprojects {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// Detox
url "$rootDir/../node_modules/detox/Detox-android"
}
// maven {
// // Detox as an .aar file (we're going to use it as a compile dependency though, to patch it)
// url "$rootDir/../node_modules/detox/Detox-android"
// }
jcenter()
}

View File

@@ -1,4 +1,5 @@
rootProject.name = '@react-native-firebase_tests'
include ':detox'
project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

View File

@@ -0,0 +1,29 @@
diff --git a/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java b/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
index 181233a..f834f6b 100644
--- a/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
+++ b/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
@@ -100,18 +100,21 @@ public class UIModuleIdlingResource implements IdlingResource, Choreographer.Fra
}
boolean isOperationQueueEmpty = (Boolean) Reflect.on(uiOperationQueue).call(METHOD_IS_EMPTY).get();
+ Log.d(LOG_TAG, "UIManagerModule queue status: runnables? / nonBatchesOps? / operationQueue? - " + runnablesAreEmpty + " / " + nonBatchesOpsEmpty + " / " + isOperationQueueEmpty);
if (runnablesAreEmpty && nonBatchesOpsEmpty && isOperationQueueEmpty) {
if (callback != null) {
callback.onTransitionToIdle();
}
- // Log.i(LOG_TAG, "UIManagerModule is idle.");
+ Log.d(LOG_TAG, "UIManagerModule is idle.");
return true;
}
Log.i(LOG_TAG, "UIManagerModule is busy.");
- Choreographer.getInstance().postFrameCallback(this);
- return false;
+ Log.w(LOG_TAG, "UIManagerModule is busy but damn the torpedoes!");
+ return true;
+ // Choreographer.getInstance().postFrameCallback(this);
+ // return false;
} catch (ReflectException e) {
Log.e(LOG_TAG, "Can't set up RN UIModule listener", e.getCause());
}