From def621f674452e70e829e23eb784386b130685c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 16 Apr 2026 06:23:35 -0700 Subject: [PATCH] Move CI validation for debugCpp and profileCpp to EnvironmentOptions (#56464) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56464 Changelog: [internal] Moved the CI validation checks for `debugCpp` and `profileCpp` from the `run()` function in `tester.js` to `validateEnvironmentVariables()` in `EnvironmentOptions.js`, alongside the existing CI/OSS validation for memory instrumentation. This centralizes all environment option validation in one place, so invalid configurations are caught early during environment setup rather than at tester execution time. Reviewed By: javache Differential Revision: D101159820 fbshipit-source-id: 1e488db6e9de3eb3bac840c4931bb1536f8b5efb --- private/react-native-fantom/runner/EnvironmentOptions.js | 8 ++++++++ private/react-native-fantom/runner/executables/tester.js | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/private/react-native-fantom/runner/EnvironmentOptions.js b/private/react-native-fantom/runner/EnvironmentOptions.js index ea47b4795a0..5ef51192b83 100644 --- a/private/react-native-fantom/runner/EnvironmentOptions.js +++ b/private/react-native-fantom/runner/EnvironmentOptions.js @@ -107,6 +107,14 @@ export function validateEnvironmentVariables(): void { } } + if (isCI && debugCpp) { + throw new Error('Cannot run Fantom with C++ debugging on CI'); + } + + if (isCI && profileCpp) { + throw new Error('Cannot run Fantom with C++ profiling on CI'); + } + // Enabling memory instrumentation is only necessary when taking JS heap // snapshots in optimized builds (where it is disabled by default). // This isn't supported in CI or in OSS because that would require adding diff --git a/private/react-native-fantom/runner/executables/tester.js b/private/react-native-fantom/runner/executables/tester.js index 05b09edb6ec..d6a48fbb75d 100644 --- a/private/react-native-fantom/runner/executables/tester.js +++ b/private/react-native-fantom/runner/executables/tester.js @@ -125,14 +125,6 @@ export function run( options: TesterOptions, env: EnvironmentOverrides, ): AsyncCommandResult { - if (isCI && debugCpp) { - throw new Error('Cannot run Fantom with C++ debugging on CI'); - } - - if (isCI && profileCpp) { - throw new Error('Cannot run Fantom with C++ profiling on CI'); - } - if (!isCI && !debugCpp) { build(options, env); }