Skip to content

Commit 1b80f01

Browse files
committed
fix(check-affected): extend macos-coverage and integration-node ownership to command-coverage/
test/integration/command-coverage/declarations.ts now carries the per-command coverage judgments that used to live directly under test/integration/macos-e2e/. Its nested path wasn't matched by macosCoverageOwnership (top-level or macos-e2e/ only) or isNodeIntegrationPath (no nested segments), so it fell through to vitest-related, which can't actually run its node --test consumers. Extend both rules to also match test/integration/command-coverage/.
1 parent aab7f5b commit 1b80f01

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

‎scripts/check-affected/model.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ test('root node-integration support modules select the node integration suite',
6969
assert.ok(ids(['test/integration/test-helpers.ts']).includes('integration-node'));
7070
});
7171

72+
test('the shared coverage declaration table selects the node integration suite and the macOS lane', () => {
73+
const result = ids(['test/integration/command-coverage/declarations.ts']);
74+
assert.ok(result.includes('integration-node'), 'expected integration-node ownership');
75+
assert.ok(result.includes('macos-coverage'), 'expected macos-coverage ownership');
76+
assert.ok(
77+
!result.includes('vitest-related'),
78+
'declarations.ts is resolved by node --test, not by Vitest',
79+
);
80+
});
81+
7282
test('android-adb stub test delegates project ownership to Vitest', () => {
7383
const result = ids(['packages/platform-android/src/__tests__/notifications.test.ts']);
7484
assert.ok(result.includes('vitest-related'));

‎scripts/check-affected/model.ts‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,12 @@ const srcProdGate: OwnershipRule = ({ file, isSrcProd }) => {
270270
};
271271

272272
function isNodeIntegrationPath(file: string): boolean {
273-
return (
274-
file.startsWith('test/integration/') &&
275-
!file.slice('test/integration/'.length).includes('/') &&
276-
file.endsWith('.ts')
277-
);
273+
if (!file.startsWith('test/integration/') || !file.endsWith('.ts')) return false;
274+
const rest = file.slice('test/integration/'.length);
275+
// command-coverage/ holds the single declaration table every platform's node --test
276+
// coverage smoke test projects its record from (#2411): a change there feeds all six
277+
// smoke tests even though the file itself sits one level below test/integration/.
278+
return !rest.includes('/') || rest.startsWith('command-coverage/');
278279
}
279280

280281
const vitestRelatedOwnership: OwnershipRule = ({ file, isTs, underSrc, underTest }) =>
@@ -351,7 +352,11 @@ const nodeIntegrationOwnership: OwnershipRule = ({ file }) =>
351352

352353
const macosCoverageOwnership: OwnershipRule = ({ file }) =>
353354
file === 'test/integration/smoke-macos-coverage.test.ts' ||
354-
file.startsWith('test/integration/macos-e2e/')
355+
file.startsWith('test/integration/macos-e2e/') ||
356+
// The per-command coverage judgments (macOS included) are declared once here and
357+
// projected into macos-e2e/coverage.ts at load time (#2411), so a table edit must
358+
// still select the macOS lane the way editing the old macos-e2e manifest did.
359+
file.startsWith('test/integration/command-coverage/')
355360
? [
356361
reason(
357362
'macos-coverage',

0 commit comments

Comments
 (0)