Skip to content
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

Better support for multiple RN version in test project + updated example projects #591

Merged
merged 8 commits into from
Mar 4, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ matrix:
os: osx
osx_image: xcode9
env:
- REACT_NATIVE_VERSION=0.44.2
- REACT_NATIVE_VERSION=0.53.3
install:
- ./scripts/install.ios.sh
script:
Expand Down
130 changes: 65 additions & 65 deletions detox/test/package.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
{
"name": "detox-test",
"version": "0.0.1",
"private": true,
"scripts": {
"test": ":",
"packager": "react-native start",
"detox-server": "detox run-server",
"e2e:ios": "detox test --configuration ios.sim.release --debug-synchronization 10000 --platform ios",
"e2e:android": "detox test --configuration android.emu.release --loglevel verbose --platform android",
"build:ios": "detox build --configuration ios.sim.release",
"build:android": "detox build --configuration android.emu.release"
},
"dependencies": {
"react": "^16.0.0-beta.5",
"react-native": "^0.49.3"
},
"devDependencies": {
"detox": "^7.0.0",
"express": "^4.15.3",
"lodash": "^4.14.1",
"mocha": "^4.0.0"
},
"detox": {
"specs": "e2e",
"__session": {
"server": "ws://localhost:8099",
"sessionId": "test"
},
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app",
"build": "set -o pipefail && xcodebuild -project ios/example.xcodeproj -scheme example_ci -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
"type": "ios.simulator",
"name": "iPhone 8 Plus"
},
"ios.sim.release": {
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/example.app",
"build": "set -o pipefail && export CODE_SIGNING_REQUIRED=NO && export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/example.xcodeproj -scheme example_ci -configuration Release -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
"type": "ios.simulator",
"name": "iPhone 8 Plus"
},
"ios.none": {
"binaryPath": "ios",
"type": "ios.none",
"name": "iPhone 8 Plus",
"session": {
"server": "ws://localhost:8099",
"sessionId": "test"
}
},
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"name": "Nexus_5X_API_26"
},
"android.emu.release": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"name": "Nexus_5X_API_26"
}
}
}
}
"name": "detox-test",
"version": "0.0.1",
"private": true,
"scripts": {
"test": ":",
"packager": "react-native start",
"detox-server": "detox run-server",
"e2e:ios": "detox test --configuration ios.sim.release --debug-synchronization 10000 --platform ios",
"e2e:android": "detox test --configuration android.emu.release --loglevel verbose --platform android",
"build:ios": "detox build --configuration ios.sim.release",
"build:android": "detox build --configuration android.emu.release"
},
"dependencies": {
"react": "16.2.0",
"react-native": "0.53.3"
},
"devDependencies": {
"detox": "^7.0.0",
"express": "^4.15.3",
"lodash": "^4.14.1",
"mocha": "^4.0.0"
},
"detox": {
"specs": "e2e",
"__session": {
"server": "ws://localhost:8099",
"sessionId": "test"
},
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app",
"build": "set -o pipefail && xcodebuild -project ios/example.xcodeproj -scheme example_ci -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
"type": "ios.simulator",
"name": "iPhone 8 Plus"
},
"ios.sim.release": {
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/example.app",
"build": "set -o pipefail && export CODE_SIGNING_REQUIRED=NO && export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/example.xcodeproj -scheme example_ci -configuration Release -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
"type": "ios.simulator",
"name": "iPhone 8 Plus"
},
"ios.none": {
"binaryPath": "ios",
"type": "ios.none",
"name": "iPhone 8 Plus",
"session": {
"server": "ws://localhost:8099",
"sessionId": "test"
}
},
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"name": "Nexus_5X_API_26"
},
"android.emu.release": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"name": "Nexus_5X_API_26"
}
}
}
}
4 changes: 2 additions & 2 deletions examples/demo-react-native-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"test-android": "detox build --configuration android.emu.debug && detox test --configuration android.emu.debug -l verbose"
},
"dependencies": {
"react": "16.0.0-beta.5",
"react-native": "0.49.3"
"react": "16.2.0",
"react-native": "0.53.3"
},
"devDependencies": {
"babel-jest": "21.2.0",
Expand Down
152 changes: 151 additions & 1 deletion examples/demo-react-native/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,76 @@
remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
remoteInfo = "jschelpers-tvOS";
};
461DC7DA2047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
remoteInfo = fishhook;
};
461DC7DC2047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
remoteInfo = "fishhook-tvOS";
};
461DC7EE2047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = EBF21BDC1FC498900052F4D5;
remoteInfo = jsinspector;
};
461DC7F02047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = EBF21BFA1FC4989A0052F4D5;
remoteInfo = "jsinspector-tvOS";
};
461DC7F22047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
remoteInfo = "third-party";
};
461DC7F42047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
remoteInfo = "third-party-tvOS";
};
461DC7F62047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 139D7E881E25C6D100323FB7;
remoteInfo = "double-conversion";
};
461DC7F82047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
remoteInfo = "double-conversion-tvOS";
};
461DC7FA2047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
remoteInfo = privatedata;
};
461DC7FC2047304200C366C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
remoteInfo = "privatedata-tvOS";
};
78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
Expand Down Expand Up @@ -317,6 +387,8 @@
children = (
139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
392FDE331E2E5F680058768A /* libRCTWebSocket-tvOS.a */,
461DC7DB2047304200C366C7 /* libfishhook.a */,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this added by RN?

461DC7DD2047304200C366C7 /* libfishhook-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -346,6 +418,14 @@
392FDE451E2E5F680058768A /* libcxxreact.a */,
392FDE471E2E5F680058768A /* libjschelpers.a */,
392FDE491E2E5F680058768A /* libjschelpers.a */,
461DC7EF2047304200C366C7 /* libjsinspector.a */,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤨

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what that is.

461DC7F12047304200C366C7 /* libjsinspector-tvOS.a */,
461DC7F32047304200C366C7 /* libthird-party.a */,
461DC7F52047304200C366C7 /* libthird-party.a */,
461DC7F72047304200C366C7 /* libdouble-conversion.a */,
461DC7F92047304200C366C7 /* libdouble-conversion.a */,
461DC7FB2047304200C366C7 /* libprivatedata.a */,
461DC7FD2047304200C366C7 /* libprivatedata-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -653,6 +733,76 @@
remoteRef = 392FDE481E2E5F680058768A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7DB2047304200C366C7 /* libfishhook.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libfishhook.a;
remoteRef = 461DC7DA2047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7DD2047304200C366C7 /* libfishhook-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libfishhook-tvOS.a";
remoteRef = 461DC7DC2047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7EF2047304200C366C7 /* libjsinspector.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libjsinspector.a;
remoteRef = 461DC7EE2047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7F12047304200C366C7 /* libjsinspector-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libjsinspector-tvOS.a";
remoteRef = 461DC7F02047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7F32047304200C366C7 /* libthird-party.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libthird-party.a";
remoteRef = 461DC7F22047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7F52047304200C366C7 /* libthird-party.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libthird-party.a";
remoteRef = 461DC7F42047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7F72047304200C366C7 /* libdouble-conversion.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libdouble-conversion.a";
remoteRef = 461DC7F62047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7F92047304200C366C7 /* libdouble-conversion.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libdouble-conversion.a";
remoteRef = 461DC7F82047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7FB2047304200C366C7 /* libprivatedata.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libprivatedata.a;
remoteRef = 461DC7FA2047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
461DC7FD2047304200C366C7 /* libprivatedata-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libprivatedata-tvOS.a";
remoteRef = 461DC7FC2047304200C366C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -694,7 +844,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
7D57265F10EEF7CD92D7973F /* Copy Detox Framework */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
4 changes: 2 additions & 2 deletions examples/demo-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"start": "react-native start"
},
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.44.0"
"react": "16.2.0",
"react-native": "0.53.3"
},
"devDependencies": {
"mocha": "^4.0.1",
Expand Down
8 changes: 4 additions & 4 deletions examples/demo-react-native/rn-cli.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const blacklist = require('react-native/packager/blacklist');
const metroBundler = require('metro-bundler');

module.exports = {
getBlacklistRE: () => blacklist([
/test\/.*/,
]),
getBlacklistRE: function() {
return metroBundler.createBlacklist([/test\/.*/]);
}
};
13 changes: 13 additions & 0 deletions scripts/change_react_native_version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let fs = require('fs');
let path = require('path');

const projectPath = process.argv[2];
const reactNativeVersion = process.argv[3];

const filePath = path.join(process.cwd(), projectPath, 'package.json');
let packageJson = require(filePath);

console.log(`Changing react-native dependency in ${filePath} to ${reactNativeVersion}`);

packageJson.dependencies['react-native'] = reactNativeVersion;
fs.writeFileSync(filePath, JSON.stringify(packageJson, null, 2));
9 changes: 3 additions & 6 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

source $(dirname "$0")/travis_logger.sh

case "$REACT_NATIVE_VERSION" in
0.44.2)
echo "Applying git patch to convert React Native version in test project to $REACT_NATIVE_VERSION"
git apply scripts/testProjRN49to44.diff --ignore-whitespace
;;
esac
if [[ -z "${REACT_NATIVE_VERSION}" ]]; then
node scripts/change_react_native_version.js "detox/test" "$REACT_NATIVE_VERSION"
fi

run_f "$(dirname "$0")/bootstrap.sh"

Expand Down
Loading