Browse Source

Enablee parallel e2e exec on Android, switch to quick-booting emu (#5686)

d4vidi 5 years ago
parent
commit
b53bbf346f
2 changed files with 6 additions and 3 deletions
  1. 3
    2
      package.json
  2. 3
    1
      scripts/test-e2e.js

+ 3
- 2
package.json View File

@@ -35,6 +35,7 @@
35 35
     "test-unit-android": "node ./scripts/test-unit --android",
36 36
     "pretest-e2e-android": "npm run build",
37 37
     "test-e2e-android": "node ./scripts/test-e2e --android",
38
+    "test-e2e-android-multi": "npm run test-e2e-android -- --multi",
38 39
     "test-e2e-android-locked": "node ./scripts/test-e2e-android-locked",
39 40
     "pretest-e2e-ios": "npm run build",
40 41
     "test-e2e-ios": "node ./scripts/test-e2e --ios",
@@ -150,13 +151,13 @@
150 151
         "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk",
151 152
         "build": "cd playground/android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug",
152 153
         "type": "android.emulator",
153
-        "name": "Pixel_2_API_26"
154
+        "name": "Nexus_5X_API_26"
154 155
       },
155 156
       "android.emu.release": {
156 157
         "binaryPath": "playground/android/app/build/outputs/apk/release/app-release.apk",
157 158
         "build": "cd playground/android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release",
158 159
         "type": "android.emulator",
159
-        "name": "Pixel_2_API_26"
160
+        "name": "Nexus_5X_API_26"
160 161
       },
161 162
       "android.emu.debug.locked": {
162 163
         "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk",

+ 3
- 1
scripts/test-e2e.js View File

@@ -6,6 +6,7 @@ const release = _.includes(process.argv, '--release');
6 6
 const skipBuild = _.includes(process.argv, '--skipBuild');
7 7
 const headless = _.includes(process.argv, '--headless');
8 8
 const multi = _.includes(process.argv, '--multi');
9
+const verbose = _.includes(process.argv, '--verbose');
9 10
 
10 11
 run();
11 12
 
@@ -15,6 +16,7 @@ function run() {
15 16
     const configuration = `${prefix}.${suffix}`;
16 17
     const headless$ = android ? headless ? `--headless` : `` : ``;
17 18
     const workers = multi ? 3 : 1;
19
+    const loglevel = verbose ? '--loglevel verbose' : '';
18 20
 
19 21
     if (!android) {
20 22
         exec.execSync('npm run build');
@@ -23,5 +25,5 @@ function run() {
23 25
     if (!skipBuild) {
24 26
         exec.execSync(`detox build --configuration ${configuration}`);
25 27
     }
26
-    exec.execSync(`detox test --configuration ${configuration} ${headless$} ${!android ? `-w ${workers}` : ``}`); //-f "ScreenStyle.test.js" --loglevel trace
28
+    exec.execSync(`detox test --configuration ${configuration} ${headless$} -w ${workers} ${loglevel}`); //-f "ScreenStyle.test.js" --loglevel trace
27 29
 }