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

Fix paths in objc-test.sh, temporarily exclude /IntegrationTests #36648

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions packages/rn-tester/RNTester/RNTester.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"testTargets" : [
{
"enabled": false,
"target" : {
"containerPath" : "container:RNTesterPods.xcodeproj",
"identifier" : "E7DB215222B2F332005AC45F",
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"directory": "packages/rn-tester"
},
"scripts": {
"start": "../react-native/scripts/packager.sh",
"start": "react-native start",
"install-android-jsc": "../../gradlew :packages:rn-tester:android:app:installJscDebug",
"install-android-hermes": "../../gradlew :packages:rn-tester:android:app:installHermesDebug",
"clean-android": "rm -rf android/app/build",
Expand Down
27 changes: 17 additions & 10 deletions scripts/objc-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ waitForWebSocketServer() {

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

buildProject() {
xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-workspace RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
}
Expand All @@ -105,30 +105,37 @@ xcbeautifyFormat() {
xcbeautify --report junit --report-path "$REPORTS_DIR/ios/results.xml"
}

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

preloadBundlesRNTester() {
# Preload RNTesterApp bundles (packages/rn-tester/)
curl -s 'http://localhost:8081/js/RNTesterApp.ios.bundle?platform=ios&dev=true' -o /dev/null
curl -s 'http://localhost:8081/js/RNTesterApp.ios.bundle?platform=ios&dev=true&minify=false' -o /dev/null
}

main() {
cd "$ROOT" || exit
cd "$ROOT/packages/rn-tester" || exit

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

# Start the WebSocket test server
echo "Launch WebSocket Server"
sh "./IntegrationTests/launchWebSocketServer.sh" &
sh "$ROOT/IntegrationTests/launchWebSocketServer.sh" &
waitForWebSocketServer

# Start the packager
yarn start --max-workers=1 || echo "Can't start packager automatically" &
waitForPackager
preloadBundles
preloadBundlesRNTester
# TODO(T149119847)
# preloadBundlesRNIntegrationTests

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