99 */
1010
1111import type { FailureDetail , TestSuiteResult } from '../runtime/setup' ;
12+ import type { TestSnapshotResults } from '../runtime/snapshotContext' ;
1213import type {
1314 AsyncCommandResult ,
1415 ConsoleLogMessage ,
@@ -25,6 +26,7 @@ import {
2526 updateSnapshotsAndGetJestSnapshotResult ,
2627} from './snapshotUtils' ;
2728import {
29+ HermesVariant as HermesVariantEnum ,
2830 getBuckModesForPlatform ,
2931 getBuckOptionsForHermes ,
3032 getDebugInfoFromCommandResult ,
@@ -34,6 +36,7 @@ import {
3436 printConsoleLog ,
3537 runBuck2 ,
3638 runBuck2Sync ,
39+ runCommand ,
3740 symbolicateStackTrace ,
3841} from './utils' ;
3942import fs from 'fs' ;
@@ -215,6 +218,47 @@ module.exports = async function runTest(
215218 const testResultsByConfig = [ ] ;
216219
217220 for ( const testConfig of testConfigs ) {
221+ if (
222+ EnvironmentOptions . isOSS &&
223+ testConfig . mode === FantomTestConfigMode . Optimized
224+ ) {
225+ testResultsByConfig . push ( [
226+ {
227+ ancestorTitles : [ '"@fantom_mode opt" in docblock' ] ,
228+ duration : 0 ,
229+ failureDetails : [ ] as Array < Error > ,
230+ failureMessages : [ ] as Array < string > ,
231+ fullName : 'Optimized mode is not yet supoprted in OSS' ,
232+ numPassingAsserts : 0 ,
233+ snapshotResults : { } as TestSnapshotResults ,
234+ status : 'pending' as 'passed' | 'failed' | 'pending' ,
235+ testFilePath : testPath ,
236+ title : 'Optimized mode is not yet supoprted in OSS' ,
237+ } ,
238+ ] ) ;
239+ continue ;
240+ }
241+
242+ if ( testConfig . hermesVariant !== HermesVariantEnum . Hermes ) {
243+ testResultsByConfig . push ( [
244+ {
245+ ancestorTitles : [
246+ '"@fantom_hermes_variant static_hermes" in docblock (shermes 🧪)' ,
247+ ] ,
248+ duration : 0 ,
249+ failureDetails : [ ] as Array < Error > ,
250+ failureMessages : [ ] as Array < string > ,
251+ fullName : 'Static Hermes is not yet supoprted in OSS' ,
252+ numPassingAsserts : 0 ,
253+ snapshotResults : { } as TestSnapshotResults ,
254+ status : 'pending' as 'passed' | 'failed' | 'pending' ,
255+ testFilePath : testPath ,
256+ title : 'Static Hermes is not yet supoprted in OSS' ,
257+ } ,
258+ ] ) ;
259+ continue ;
260+ }
261+
218262 const entrypointContents = entrypointTemplate ( {
219263 testPath : `${ path . relative ( BUILD_OUTPUT_PATH , testPath ) } ` ,
220264 setupModulePath : `${ path . relative ( BUILD_OUTPUT_PATH , setupModulePath ) } ` ,
@@ -261,28 +305,37 @@ module.exports = async function runTest(
261305 } ) ;
262306 }
263307
264- const rnTesterCommandResult = runBuck2 (
265- [
266- 'run' ,
267- ...getBuckModesForPlatform (
268- testConfig . mode === FantomTestConfigMode . Optimized ,
269- ) ,
270- ...getBuckOptionsForHermes ( testConfig . hermesVariant ) ,
271- '//xplat/js/react-native-github/private/react-native-fantom/tester:tester' ,
272- '--' ,
273- '--bundlePath' ,
274- testConfig . mode === FantomTestConfigMode . DevelopmentWithSource
275- ? testJSBundlePath
276- : testBytecodeBundlePath ,
277- '--featureFlags' ,
278- JSON . stringify ( testConfig . flags . common ) ,
279- '--minLogLevel' ,
280- EnvironmentOptions . printCLIOutput ? 'info' : 'error' ,
281- ] ,
282- {
283- withFDB : EnvironmentOptions . enableCppDebugging ,
284- } ,
285- ) ;
308+ const rnTesterCommandArgs = [
309+ '--bundlePath' ,
310+ testConfig . mode === FantomTestConfigMode . DevelopmentWithSource
311+ ? testJSBundlePath
312+ : testBytecodeBundlePath ,
313+ '--featureFlags' ,
314+ JSON . stringify ( testConfig . flags . common ) ,
315+ '--minLogLevel' ,
316+ EnvironmentOptions . printCLIOutput ? 'info' : 'error' ,
317+ ] ;
318+
319+ const rnTesterCommandResult = EnvironmentOptions . isOSS
320+ ? runCommand (
321+ path . join ( __dirname , '..' , 'build' , 'tester' , 'fantom_tester' ) ,
322+ rnTesterCommandArgs ,
323+ )
324+ : runBuck2 (
325+ [
326+ 'run' ,
327+ ...getBuckModesForPlatform (
328+ testConfig . mode === FantomTestConfigMode . Optimized ,
329+ ) ,
330+ ...getBuckOptionsForHermes ( testConfig . hermesVariant ) ,
331+ '//xplat/js/react-native-github/private/react-native-fantom/tester:tester' ,
332+ '--' ,
333+ ...rnTesterCommandArgs ,
334+ ] ,
335+ {
336+ withFDB : EnvironmentOptions . enableCppDebugging ,
337+ } ,
338+ ) ;
286339
287340 const processedResult = await processRNTesterCommandResult (
288341 rnTesterCommandResult ,
0 commit comments