Skip to content

Commit 24909fb

Browse files
rubennortefacebook-github-bot
authored andcommitted
Move CI validation for debugCpp and profileCpp to EnvironmentOptions
Summary: 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. Differential Revision: D101159820
1 parent 07c00f4 commit 24909fb

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

private/react-native-fantom/runner/EnvironmentOptions.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ export function validateEnvironmentVariables(): void {
107107
}
108108
}
109109

110+
if (isCI && debugCpp) {
111+
throw new Error('Cannot run Fantom with C++ debugging on CI');
112+
}
113+
114+
if (isCI && profileCpp) {
115+
throw new Error('Cannot run Fantom with C++ profiling on CI');
116+
}
117+
110118
// Enabling memory instrumentation is only necessary when taking JS heap
111119
// snapshots in optimized builds (where it is disabled by default).
112120
// This isn't supported in CI or in OSS because that would require adding

private/react-native-fantom/runner/executables/tester.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,6 @@ export function run(
125125
options: TesterOptions,
126126
env: EnvironmentOverrides,
127127
): AsyncCommandResult {
128-
if (isCI && debugCpp) {
129-
throw new Error('Cannot run Fantom with C++ debugging on CI');
130-
}
131-
132-
if (isCI && profileCpp) {
133-
throw new Error('Cannot run Fantom with C++ profiling on CI');
134-
}
135-
136128
if (!isCI && !debugCpp) {
137129
build(options, env);
138130
}

0 commit comments

Comments
 (0)