Browse Source

making ios e2e great again

Daniel Zlotin 7 years ago
parent
commit
b9ef478ca9

+ 16
- 2
lib/ios/ReactNativeNavigation.xcodeproj/xcshareddata/xcschemes/ReactNativeNavigation.xcscheme View File

@@ -3,9 +3,23 @@
3 3
    LastUpgradeVersion = "0820"
4 4
    version = "1.3">
5 5
    <BuildAction
6
-      parallelizeBuildables = "YES"
6
+      parallelizeBuildables = "NO"
7 7
       buildImplicitDependencies = "YES">
8 8
       <BuildActionEntries>
9
+         <BuildActionEntry
10
+            buildForTesting = "YES"
11
+            buildForRunning = "YES"
12
+            buildForProfiling = "YES"
13
+            buildForArchiving = "YES"
14
+            buildForAnalyzing = "YES">
15
+            <BuildableReference
16
+               BuildableIdentifier = "primary"
17
+               BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
18
+               BuildableName = "libReact.a"
19
+               BlueprintName = "React"
20
+               ReferencedContainer = "container:../../node_modules/react-native/React/React.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
9 23
          <BuildActionEntry
10 24
             buildForTesting = "YES"
11 25
             buildForRunning = "YES"
@@ -23,7 +37,7 @@
23 37
       </BuildActionEntries>
24 38
    </BuildAction>
25 39
    <TestAction
26
-      buildConfiguration = "Debug"
40
+      buildConfiguration = "Release"
27 41
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28 42
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29 43
       shouldUseLaunchSchemeArgsEnv = "YES">

+ 2
- 2
scripts/test.all.js View File

@@ -2,9 +2,9 @@ const exec = require('shell-utils').exec;
2 2
 
3 3
 function run() {
4 4
   exec.execSync(`yarn run test-js`);
5
-  exec.execSync(`yarn run test-unit-android && yarn run test-unit-ios`);
5
+  exec.execSync(`yarn run test-unit-android && yarn run test-unit-ios -- release`);
6 6
   exec.exec(`yarn run test-e2e-android`);
7
-  exec.exec(`yarn run test-e2e-ios`);
7
+  exec.exec(`yarn run test-e2e-ios -- release`);
8 8
 }
9 9
 
10 10
 run();

+ 2
- 1
scripts/test.e2e.ios.js View File

@@ -14,7 +14,8 @@ function buildProjForDetox() {
14 14
             -project playground.xcodeproj
15 15
             -sdk iphonesimulator
16 16
             -configuration ${conf}
17
-            -derivedDataPath ./DerivedData/playground`;
17
+            -derivedDataPath ./DerivedData/playground
18
+            ONLY_ACTIVE_ARCH=YES`;
18 19
 
19 20
   if (exec.which(`xcpretty`)) {
20 21
     exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);

+ 10
- 3
scripts/test.unit.ios.js View File

@@ -1,5 +1,8 @@
1
+const _ = require('lodash');
1 2
 const exec = require('shell-utils').exec;
2 3
 
4
+const release = _.includes(process.argv, 'release');
5
+
3 6
 function runWithXcpretty(cmd) {
4 7
   if (exec.which(`xcpretty`)) {
5 8
     exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);
@@ -9,22 +12,26 @@ function runWithXcpretty(cmd) {
9 12
 }
10 13
 
11 14
 function run() {
15
+  const conf = release ? `Release` : `Debug`;
12 16
   runWithXcpretty(`RCT_NO_LAUNCH_PACKAGER=true
13 17
           cd ./playground/ios && xcodebuild
14 18
             build build-for-testing
15 19
             -scheme "ReactNativeNavigation"
16 20
             -project playground.xcodeproj
17 21
             -sdk iphonesimulator
18
-            -configuration Debug
19
-            -derivedDataPath ./DerivedData/playground`);
22
+            -configuration ${conf}
23
+            -derivedDataPath ./DerivedData/playground
24
+            ONLY_ACTIVE_ARCH=YES`);
20 25
   runWithXcpretty(`RCT_NO_LAUNCH_PACKAGER=true
21 26
           cd ./playground/ios && xcodebuild
22 27
             test-without-building
23 28
             -scheme "ReactNativeNavigation"
24 29
             -project playground.xcodeproj
25 30
             -sdk iphonesimulator
31
+            -configuration ${conf}
26 32
             -destination 'platform=iOS Simulator,name=iPhone 7'
27
-            -derivedDataPath ./DerivedData/playground`);
33
+            -derivedDataPath ./DerivedData/playground
34
+            ONLY_ACTIVE_ARCH=YES`);
28 35
 }
29 36
 
30 37
 run();

+ 1
- 1
scripts/travis.sh View File

@@ -22,7 +22,7 @@ run_f () {
22 22
 run_f "yarn install"
23 23
 run_f "yarn run test-js"
24 24
 run_f "yarn run test-unit-android"
25
-run_f "yarn run test-unit-ios"
25
+run_f "yarn run test-unit-ios -- release"
26 26
 run_f "yarn run test-e2e-android"
27 27
 run_f "yarn run test-e2e-ios -- release"
28 28
 run_f "yarn run release"