Skip to content

Commit dbd3255

Browse files
rubennortemeta-codesync[bot]
authored andcommitted
Build both coverage and non-coverage tester binaries in CI (#56538)
Summary: Pull Request resolved: #56538 The Fantom Jest `globalSetup` builds the `fantom-tester` native binaries upfront, using `globalConfig.collectCoverage` to decide whether to build the `-coverage` flavor. However, `runner/coverageUtils.js`'s `shouldCollectCoverage()` returns `false` for some tests even when `globalConfig.collectCoverage` is true: - All benchmarks (filename matches `*Benchmark-itest.*`) - Tests with the `fantom_disable_coverage` pragma In CI coverage runs, those tests resolve their tester binary path with `enableCoverage=false` (e.g. `fantom-tester-statichermesstable-opt`), but `globalSetup` only built the `-coverage` variants, so spawn fails with `ENOENT` and the test fails with an empty stdout/stderr and exit code `-2`. When `enableCoverage` is true, also build the non-coverage tester variants so coverage-opt-out tests can find their binary. Changelog: [Internal] Reviewed By: javache Differential Revision: D101819861 fbshipit-source-id: e82f7c8c548c9477d214e9265c813bf9b54ab141
1 parent 5f69a91 commit dbd3255

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

  • private/react-native-fantom/runner/global-setup

private/react-native-fantom/runner/global-setup/build.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,25 @@ export default async function build(
5050
fs.mkdirSync(NATIVE_BUILD_OUTPUT_PATH, {recursive: true});
5151

5252
if (isCI) {
53+
// When `enableCoverage` is true (CI coverage runs), we still need the
54+
// non-coverage tester binaries because some tests opt out of coverage
55+
// (benchmarks via filename, or tests with the `@fantom_disable_coverage`
56+
// pragma — see `runner/coverageUtils.js`). Without these, those tests
57+
// would fail to spawn with ENOENT.
58+
const coverageVariants = enableCoverage ? [false, true] : [false];
59+
5360
for (const enableOptimized of [false, true]) {
5461
for (const hermesVariant of HermesVariant.members()) {
55-
buildFantomTester(
56-
{enableOptimized, hermesVariant, enableCoverage},
57-
env,
58-
);
62+
for (const variantEnableCoverage of coverageVariants) {
63+
buildFantomTester(
64+
{
65+
enableOptimized,
66+
hermesVariant,
67+
enableCoverage: variantEnableCoverage,
68+
},
69+
env,
70+
);
71+
}
5972
buildHermesCompiler({enableOptimized, hermesVariant, enableCoverage});
6073
}
6174
}

0 commit comments

Comments
 (0)