From 139f3369dea7ee76af3f95243860f6544b433ff8 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 15 Jul 2025 10:04:21 -0700 Subject: [PATCH 1/2] Update atrifact names to the new ones (#52618) Summary: In 0.81 we dropped the JSC configuration in CI. That means that the artifacts we generate in CI have a slightly different name. The current e2e script failed to run with the ci flag because it was still using the old artifacts name and it was not finding them. This change adress the problem by: - using the right artifact names - removing the --hermes parameter which controlled the Hermes vs JSC scenario. It is also a port to main of [this PR](https://github.com/facebook/react-native/pull/52606) ## Changelog: [Internal] - Reviewed By: vzaidman Differential Revision: D78344244 --- scripts/release-testing/test-release-local.js | 56 ++++--------------- .../utils/github-actions-utils.js | 5 -- 2 files changed, 12 insertions(+), 49 deletions(-) diff --git a/scripts/release-testing/test-release-local.js b/scripts/release-testing/test-release-local.js index 9a0768bb474659..df3db66297cfb1 100644 --- a/scripts/release-testing/test-release-local.js +++ b/scripts/release-testing/test-release-local.js @@ -48,11 +48,6 @@ const argv = yargs coerce: platform => platform.toLowerCase(), choices: ['ios', 'android'], }) - .option('h', { - alias: 'hermes', - type: 'boolean', - default: true, - }) .option('c', { alias: 'ciToken', type: 'string', @@ -80,9 +75,7 @@ async function testRNTesterIOS( onReleaseBranch /*: boolean */, ) { console.info( - `We're going to test the ${ - argv.hermes === true ? 'Hermes' : 'JSC' - } version of RNTester iOS with the new Architecture enabled`, + `We're going to test the 'Hermes' version of RNTester iOS with the new Architecture enabled`, ); // if everything succeeded so far, we can launch Metro and the app @@ -98,25 +91,15 @@ async function testRNTesterIOS( 'RNTester.app', ); exec(`rm -rf ${appOutputFolder}`); - if (argv.hermes === true) { - // download hermes App - const hermesAppUrl = await ciArtifacts.artifactURLForHermesRNTesterApp(); - const hermesAppZipPath = path.join( - ciArtifacts.baseTmpPath(), - 'RNTesterAppHermes.zip', - ); - ciArtifacts.downloadArtifact(hermesAppUrl, hermesAppZipPath); - exec(`unzip ${hermesAppZipPath} -d ${appOutputFolder}`); - } else { - // download JSC app - const hermesAppUrl = await ciArtifacts.artifactURLForJSCRNTesterApp(); - const hermesAppZipPath = path.join( - ciArtifacts.baseTmpPath(), - 'RNTesterAppJSC.zip', - ); - ciArtifacts.downloadArtifact(hermesAppUrl, hermesAppZipPath); - exec(`unzip ${hermesAppZipPath} -d ${appOutputFolder}`); - } + + // download hermes App + const hermesAppUrl = await ciArtifacts.artifactURLForHermesRNTesterApp(); + const hermesAppZipPath = path.join( + ciArtifacts.baseTmpPath(), + 'RNTesterAppHermes.zip', + ); + ciArtifacts.downloadArtifact(hermesAppUrl, hermesAppZipPath); + exec(`unzip ${hermesAppZipPath} -d ${appOutputFolder}`); // boot device const bootedDevice = String( @@ -135,9 +118,7 @@ async function testRNTesterIOS( exec('xcrun simctl launch booted com.meta.RNTester.localDevelopment'); } else { exec( - `USE_HERMES=${ - argv.hermes === true ? 1 : 0 - } CI=${onReleaseBranch.toString()} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`, + `USE_HERMES=1 CI=${onReleaseBranch.toString()} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`, ); // launch the app on iOS simulator @@ -320,26 +301,13 @@ async function testRNTestProject( 'reactNativeArchitectures=arm64-v8a', 'android/gradle.properties', ); - const hermesEnabled = (await argv).hermes === true; - - // Update gradle properties to set Hermes as false - if (!hermesEnabled) { - sed( - '-i', - 'hermesEnabled=true', - 'hermesEnabled=false', - 'android/gradle.properties', - ); - } if (argv.platform === 'ios') { // doing the pod install here so that it's easier to play around RNTestProject cd('ios'); exec('bundle install'); exec( - `HERMES_ENGINE_TARBALL_PATH=${hermesPath} USE_HERMES=${ - hermesEnabled ? 1 : 0 - } bundle exec pod install --ansi`, + `HERMES_ENGINE_TARBALL_PATH=${hermesPath} USE_HERMES=1 bundle exec pod install --ansi`, ); cd('..'); diff --git a/scripts/release-testing/utils/github-actions-utils.js b/scripts/release-testing/utils/github-actions-utils.js index f92b01c5ee3c88..62b8d2e760c972 100644 --- a/scripts/release-testing/utils/github-actions-utils.js +++ b/scripts/release-testing/utils/github-actions-utils.js @@ -209,10 +209,6 @@ async function artifactURLForRNTesterAPK( return getArtifactURL('rntester-debug'); } -async function artifactURLForJSCRNTesterApp() /*: Promise */ { - return getArtifactURL('RNTesterApp-NewArch-JSC-Debug'); -} - async function artifactURLForHermesRNTesterApp() /*: Promise */ { return getArtifactURL('RNTesterApp-NewArch-Hermes-Debug'); } @@ -249,7 +245,6 @@ module.exports = { initialize, downloadArtifact, artifactURLForRNTesterAPK, - artifactURLForJSCRNTesterApp, artifactURLForHermesRNTesterApp, artifactURLForMavenLocal, artifactURLHermesDebug, From 871b98c8d2ec0fb23731ac84571f54ce25938749 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 15 Jul 2025 10:04:21 -0700 Subject: [PATCH 2/2] Fix E2E test script when the ci flag is not specified (#52617) Summary: The `test-release-local` script was failing to execute the npx rreact-native run-ios command for some issues with cocoapods. That command tries to reinstall the pods so there might be some issues when testing. As an alternative, we can avoid duplicated work by dropping the npx react-native command and, instead, build the app with xcodebuild and install it in the simulator with xcrun. This is a backport of [this PR](https://github.com/facebook/react-native/pull/52609) ## Changelog: [Internal] - Reviewed By: vzaidman Differential Revision: D78344397 --- scripts/release-testing/test-release-local.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/release-testing/test-release-local.js b/scripts/release-testing/test-release-local.js index df3db66297cfb1..8c568e94105b43 100644 --- a/scripts/release-testing/test-release-local.js +++ b/scripts/release-testing/test-release-local.js @@ -113,19 +113,26 @@ async function testRNTesterIOS( // install app on device exec(`xcrun simctl install booted ${appOutputFolder}`); - - // launch the app on iOS simulator - exec('xcrun simctl launch booted com.meta.RNTester.localDevelopment'); } else { exec( `USE_HERMES=1 CI=${onReleaseBranch.toString()} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`, ); - // launch the app on iOS simulator + // build the app on iOS simulator + exec( + 'xcodebuild -workspace RNTesterPods.xcworkspace -scheme RNTester -sdk "iphonesimulator" -destination "generic/platform=iOS Simulator" -derivedDataPath "/tmp/RNTesterBuild"', + ); + // boot device + exec('xcrun simctl boot "iPhone 16 Pro"'); + // install app on device exec( - 'npx react-native run-ios --scheme RNTester --simulator "iPhone 15 Pro"', + 'xcrun simctl install booted "/tmp/RNTesterBuild/Build/Products/Debug-iphonesimulator/RNTester.app"', ); + // bring iOS simulator to the front + exec('open -a simulator'); } + // launch the app on iOS simulator + exec('xcrun simctl launch booted com.meta.RNTester.localDevelopment'); } /**