From 0d3f8c17f06a02e2b2b76feb2e5026a1f816346f Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Tue, 3 Dec 2024 16:14:32 -0800 Subject: [PATCH] fix hermes param handling in test-e2e-local.js (#48068) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: why: running `yarn test-e2e-local -t "RNTestProject" -p "Android" -h false -c $GITHUB_TOKEN` would actually build the app with Hermes even though it's specified as disabled. This is because of the `if (argv.hermes == null)` condition whose body would not execute. The condition was changed [recently](https://github.com/facebook/react-native/commit/f322dc7a84eb72370910f6933d0a4fa7780f49bc#diff-56f57bf0eac99b0fda1b2938aceb8d9b663db82c07cb405bd53a01c8689710ffR258). Reason for `await` being used: ``` Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ scripts/release-testing/test-e2e-local.js:303:32 Cannot get argv.hermes because property hermes is missing in Promise [1]. [prop-missing] scripts/release-testing/test-e2e-local.js 300│ 'reactNativeArchitectures=arm64-v8a', 301│ 'android/gradle.properties', 302│ ); 303│ const hermesEnabled = (argv).hermes === true; 304│ 305│ // Update gradle properties to set Hermes as false 306│ if (!hermesEnabled) { flow-typed/npm/yargs_v17.x.x.js [1] 80│ argv: Argv | Promise; ``` ## Changelog: [INTERNAL] [FIXED] - fix `hermes` param handling in `test-e2e-local.js` Pull Request resolved: https://github.com/facebook/react-native/pull/48068 Test Plan: tested locally Reviewed By: cipolleschi Differential Revision: D66704263 Pulled By: robhogan fbshipit-source-id: f05f23b95e67bd20025e0b3448df0d284fcb62da --- scripts/release-testing/test-e2e-local.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/release-testing/test-e2e-local.js b/scripts/release-testing/test-e2e-local.js index ea77c3d205ee1c..34661737815ab7 100644 --- a/scripts/release-testing/test-e2e-local.js +++ b/scripts/release-testing/test-e2e-local.js @@ -300,9 +300,10 @@ async function testRNTestProject( 'reactNativeArchitectures=arm64-v8a', 'android/gradle.properties', ); + const hermesEnabled = (await argv).hermes === true; // Update gradle properties to set Hermes as false - if (argv.hermes == null) { + if (!hermesEnabled) { sed( '-i', 'hermesEnabled=true', @@ -317,7 +318,7 @@ async function testRNTestProject( exec('bundle install'); exec( `HERMES_ENGINE_TARBALL_PATH=${hermesPath} USE_HERMES=${ - argv.hermes === true ? 1 : 0 + hermesEnabled ? 1 : 0 } bundle exec pod install --ansi`, );