Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/check-affected/device-lanes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test('the macOS coverage manifest selects its executable gate and macOS replay l
'macos-coverage',
'replay-macos',
]);
assert.deepEqual(lanes('test/integration/macos-e2e/coverage-manifest.ts'), [
assert.deepEqual(lanes('test/integration/macos-e2e/coverage.ts'), [
'macos-coverage',
'replay-macos',
]);
Expand Down
10 changes: 10 additions & 0 deletions scripts/check-affected/model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ test('root node-integration support modules select the node integration suite',
assert.ok(ids(['test/integration/test-helpers.ts']).includes('integration-node'));
});

test('the shared coverage declaration table selects the node integration suite and the macOS lane', () => {
const result = ids(['test/integration/command-coverage/declarations.ts']);
assert.ok(result.includes('integration-node'), 'expected integration-node ownership');
assert.ok(result.includes('macos-coverage'), 'expected macos-coverage ownership');
assert.ok(
!result.includes('vitest-related'),
'declarations.ts is resolved by node --test, not by Vitest',
);
});

test('android-adb stub test delegates project ownership to Vitest', () => {
const result = ids(['packages/platform-android/src/__tests__/notifications.test.ts']);
assert.ok(result.includes('vitest-related'));
Expand Down
17 changes: 11 additions & 6 deletions scripts/check-affected/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,12 @@ const srcProdGate: OwnershipRule = ({ file, isSrcProd }) => {
};

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

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

const macosCoverageOwnership: OwnershipRule = ({ file }) =>
file === 'test/integration/smoke-macos-coverage.test.ts' ||
file.startsWith('test/integration/macos-e2e/')
file.startsWith('test/integration/macos-e2e/') ||
// The per-command coverage judgments (macOS included) are declared once here and
// projected into macos-e2e/coverage.ts at load time (#2411), so a table edit must
// still select the macOS lane the way editing the old macos-e2e manifest did.
file.startsWith('test/integration/command-coverage/')
? [
reason(
'macos-coverage',
Expand Down
2 changes: 1 addition & 1 deletion scripts/depgraph/affected-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const HANDLER_CHAIN_FILE = 'src/daemon/request-handler-chain.ts';
* needs — command name to owning scenario — so this lane does not depend on the rest of that
* manifest's vocabulary, and reports honestly when it is not in the tree yet.
*/
const LIVE_COVERAGE_MANIFEST = 'test/integration/ios-simulator-e2e/coverage-manifest.ts';
const LIVE_COVERAGE_MANIFEST = 'test/integration/ios-simulator-e2e/coverage.ts';
const LIVE_COVERAGE_EXPORT = 'IOS_SIMULATOR_E2E_COVERAGE';

type LiveCoverageEntry = { level: string; owner: unknown; assertion: string };
Expand Down
2 changes: 1 addition & 1 deletion test/integration/android-emulator-coverage-report.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'node:path';
import test from 'node:test';

import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog';
import { ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY } from './android-emulator-e2e/coverage-manifest.ts';
import { ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY } from './android-emulator-e2e/coverage.ts';
import type { LiveContext } from './android-emulator-e2e/live-harness.ts';
import { writeCoverageReport } from './android-emulator-e2e/live-coverage-report.ts';

Expand Down
226 changes: 0 additions & 226 deletions test/integration/android-emulator-e2e/coverage-manifest.ts

This file was deleted.

20 changes: 20 additions & 0 deletions test/integration/android-emulator-e2e/coverage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { projectCoverage } from '../command-coverage/declarations.ts';
import type { PublicCommand } from '../command-coverage/entries.ts';
import { buildCoverageClassificationSummary } from '../support/coverage-classification.ts';

/**
* One primary, observable owner for every public command on an Android emulator.
*
* Projected from the command-owned declaration table; the rows are authored there.
*/
export const ANDROID_EMULATOR_E2E_COVERAGE = projectCoverage('androidEmulator');

export const ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY = buildCoverageClassificationSummary(
Object.values(ANDROID_EMULATOR_E2E_COVERAGE),
);

export function liveCommandsForScenario(scenarioId: string): PublicCommand[] {
return Object.entries(ANDROID_EMULATOR_E2E_COVERAGE)
.filter(([, entry]) => entry.level === 'live' && entry.scenario === scenarioId)
.map(([command]) => command as PublicCommand);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import {
ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY,
liveCommandsForScenario,
} from './coverage-manifest.ts';
} from './coverage.ts';
import type { LiveContext } from './live-harness.ts';

export function assertCoverageComplete(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/android-emulator-e2e/live-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
type LiveDeviceContext,
} from '../live-device-e2e/runtime.ts';
import type { AndroidEmulatorBehaviorId } from './behavior-coverage.ts';
import { liveCommandsForScenario } from './coverage-manifest.ts';
import { liveCommandsForScenario } from './coverage.ts';
import { liveBehaviorsForScenario, writeCoverageReport } from './live-coverage-report.ts';

export { assertCoverageComplete, writeCoverageReport } from './live-coverage-report.ts';
Expand Down
Loading
Loading