Skip to content

Commit 64db465

Browse files
huntiefacebook-github-bot
authored andcommitted
Fix paths in objc-test.sh, temporarily exclude /IntegrationTests (facebook#36648)
Summary: Pull Request resolved: facebook#36648 Changelog: [Internal] Blocker for facebook#36623. The `test-ios` job in CI was misconfigured following the monorepo migration — and this becomes load-bearing with the incoming version of React Native CLI. - Update `objc-test.sh` to run in `packages/rn-tester`, and exclude tests under `/IntegrationTests` which are outside of a Metro project directory. - **This is temporary** — a task has been created to move/split up/otherwise restore tests in `IntegrationTests`, which cipolleschi is following up (thanks!). - Also fix `yarn start` script in `packages/rn-tester`. Reviewed By: cipolleschi Differential Revision: D44416533 fbshipit-source-id: e200d7d1462d5ca4e263e21ff1e885929970068b
1 parent 406f9fc commit 64db465

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

packages/rn-tester/RNTester/RNTester.xctestplan

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"testTargets" : [
3030
{
31+
"enabled": false,
3132
"target" : {
3233
"containerPath" : "container:RNTesterPods.xcodeproj",
3334
"identifier" : "E7DB215222B2F332005AC45F",

packages/rn-tester/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"directory": "packages/rn-tester"
1212
},
1313
"scripts": {
14-
"start": "../react-native/scripts/packager.sh",
14+
"start": "react-native start",
1515
"install-android-jsc": "../../gradlew :packages:rn-tester:android:app:installJscDebug",
1616
"install-android-hermes": "../../gradlew :packages:rn-tester:android:app:installHermesDebug",
1717
"clean-android": "rm -rf android/app/build",

scripts/objc-test.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ waitForWebSocketServer() {
7575

7676
runTests() {
7777
# shellcheck disable=SC1091
78-
source "./scripts/.tests.env"
78+
source "$ROOT/scripts/.tests.env"
7979
xcodebuild build test \
80-
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
80+
-workspace RNTesterPods.xcworkspace \
8181
-scheme RNTester \
8282
-sdk iphonesimulator \
8383
-destination "platform=iOS Simulator,name=$IOS_DEVICE,OS=$IOS_TARGET_OS" \
@@ -86,7 +86,7 @@ runTests() {
8686

8787
buildProject() {
8888
xcodebuild build \
89-
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
89+
-workspace RNTesterPods.xcworkspace \
9090
-scheme RNTester \
9191
-sdk iphonesimulator
9292
}
@@ -105,30 +105,37 @@ xcbeautifyFormat() {
105105
xcbeautify --report junit --report-path "$REPORTS_DIR/ios/results.xml"
106106
}
107107

108-
preloadBundles() {
109-
# Preload the RNTesterApp bundle for better performance in integration tests
110-
curl -s 'http://localhost:8081/packages/rn-tester/js/RNTesterApp.ios.bundle?platform=ios&dev=true' -o /dev/null
111-
curl -s 'http://localhost:8081/packages/rn-tester/js/RNTesterApp.ios.bundle?platform=ios&dev=true&minify=false' -o /dev/null
108+
preloadBundlesRNIntegrationTests() {
109+
# Preload IntegrationTests bundles (/)
110+
# TODO(T149119847): These need to be relocated into a dir with a Metro config
112111
curl -s 'http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=ios&dev=true' -o /dev/null
113112
curl -s 'http://localhost:8081/IntegrationTests/RCTRootViewIntegrationTestApp.bundle?platform=ios&dev=true' -o /dev/null
114113
}
115114

115+
preloadBundlesRNTester() {
116+
# Preload RNTesterApp bundles (packages/rn-tester/)
117+
curl -s 'http://localhost:8081/js/RNTesterApp.ios.bundle?platform=ios&dev=true' -o /dev/null
118+
curl -s 'http://localhost:8081/js/RNTesterApp.ios.bundle?platform=ios&dev=true&minify=false' -o /dev/null
119+
}
120+
116121
main() {
117-
cd "$ROOT" || exit
122+
cd "$ROOT/packages/rn-tester" || exit
118123

119124
# If first argument is "test", actually start the packager and run tests.
120125
# Otherwise, just build RNTester and exit
121126
if [ "$1" = "test" ]; then
122127

123128
# Start the WebSocket test server
124129
echo "Launch WebSocket Server"
125-
sh "./IntegrationTests/launchWebSocketServer.sh" &
130+
sh "$ROOT/IntegrationTests/launchWebSocketServer.sh" &
126131
waitForWebSocketServer
127132

128133
# Start the packager
129134
yarn start --max-workers=1 || echo "Can't start packager automatically" &
130135
waitForPackager
131-
preloadBundles
136+
preloadBundlesRNTester
137+
# TODO(T149119847)
138+
# preloadBundlesRNIntegrationTests
132139

133140
# Build and run tests.
134141
if [ -x "$(command -v xcbeautify)" ]; then

0 commit comments

Comments
 (0)