Skip to content

Commit 1577484

Browse files
andrewdacenkofacebook-github-bot
authored andcommitted
skip bytecode support for hermes
Summary: Changelog: [Internal] Currently tests that depend on hermes dev bytecode will fail because in OSS this case was not handled. We need to skip them for now before we integrate hermes compiler properly. Differential Revision: D78750791
1 parent 0f25a35 commit 1577484

1 file changed

Lines changed: 49 additions & 27 deletions

File tree

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

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
* @format
99
*/
1010

11-
import type {FailureDetail, TestSuiteResult} from '../runtime/setup';
11+
import type {
12+
FailureDetail,
13+
TestCaseResult,
14+
TestSuiteResult,
15+
} from '../runtime/setup';
1216
import type {TestSnapshotResults} from '../runtime/snapshotContext';
1317
import type {
1418
AsyncCommandResult,
@@ -218,48 +222,66 @@ module.exports = async function runTest(
218222

219223
const testResultsByConfig = [];
220224

225+
const skippedTestResults = ({
226+
ancestorTitles,
227+
title,
228+
}: {
229+
ancestorTitles: string[],
230+
title: string,
231+
}) => [
232+
{
233+
ancestorTitles,
234+
duration: 0,
235+
failureDetails: [] as Array<Error>,
236+
failureMessages: [] as Array<string>,
237+
fullName: title,
238+
numPassingAsserts: 0,
239+
snapshotResults: {} as TestSnapshotResults,
240+
status: 'pending' as TestCaseResult['status'],
241+
testFilePath: testPath,
242+
title,
243+
},
244+
];
245+
221246
for (const testConfig of testConfigs) {
222247
if (
223248
EnvironmentOptions.isOSS &&
224249
testConfig.mode === FantomTestConfigMode.Optimized
225250
) {
226-
testResultsByConfig.push([
227-
{
251+
testResultsByConfig.push(
252+
skippedTestResults({
228253
ancestorTitles: ['"@fantom_mode opt" in docblock'],
229-
duration: 0,
230-
failureDetails: [] as Array<Error>,
231-
failureMessages: [] as Array<string>,
232-
fullName: 'Optimized mode is not yet supoprted in OSS',
233-
numPassingAsserts: 0,
234-
snapshotResults: {} as TestSnapshotResults,
235-
status: 'pending' as 'passed' | 'failed' | 'pending',
236-
testFilePath: testPath,
237-
title: 'Optimized mode is not yet supoprted in OSS',
238-
},
239-
]);
254+
title: 'Optimized mode is not yet supported in OSS',
255+
}),
256+
);
240257
continue;
241258
}
242259

243260
if (
244261
EnvironmentOptions.isOSS &&
245262
testConfig.hermesVariant !== HermesVariantEnum.Hermes
246263
) {
247-
testResultsByConfig.push([
248-
{
264+
testResultsByConfig.push(
265+
skippedTestResults({
249266
ancestorTitles: [
250267
'"@fantom_hermes_variant static_hermes" in docblock (shermes 🧪)',
251268
],
252-
duration: 0,
253-
failureDetails: [] as Array<Error>,
254-
failureMessages: [] as Array<string>,
255-
fullName: 'Static Hermes is not yet supoprted in OSS',
256-
numPassingAsserts: 0,
257-
snapshotResults: {} as TestSnapshotResults,
258-
status: 'pending' as 'passed' | 'failed' | 'pending',
259-
testFilePath: testPath,
260-
title: 'Static Hermes is not yet supoprted in OSS',
261-
},
262-
]);
269+
title: 'Static Hermes is not yet supported in OSS',
270+
}),
271+
);
272+
continue;
273+
}
274+
275+
if (
276+
EnvironmentOptions.isOSS &&
277+
testConfig.mode !== FantomTestConfigMode.DevelopmentWithSource
278+
) {
279+
testResultsByConfig.push(
280+
skippedTestResults({
281+
ancestorTitles: ['"@fantom_mode dev-bytecode" in docblock'],
282+
title: 'Hermes bytecode is not yet supported in OSS',
283+
}),
284+
);
263285
continue;
264286
}
265287

0 commit comments

Comments
 (0)