Skip to content

Commit 7260fda

Browse files
authored
refactor(move): relocate daemon Maestro replay tests (#3034)
1 parent 192ac0b commit 7260fda

12 files changed

Lines changed: 53 additions & 53 deletions

src/daemon/replay/internal/__tests__/session-replay-maestro-error-projection.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-maestro-error-projection.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import fs from 'node:fs';
22
import path from 'node:path';
33
import { expect, test } from 'vitest';
44
import { stringify } from 'yaml';
5-
import { runTypedMaestroReplay } from '../session-replay-maestro-runtime.ts';
6-
import { SessionStore } from '../../../session-store.ts';
7-
import { replayCommandForTest } from '../../__tests__/replay-command-fixture.ts';
8-
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
9-
import { maestroScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
10-
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
11-
import type { DaemonRequest } from '../../../daemon-request.ts';
5+
import { runTypedMaestroReplay } from '../../replay/internal/session-replay-maestro-runtime.ts';
6+
import { SessionStore } from '../../session-store.ts';
7+
import { replayCommandForTest } from '../../replay/__tests__/replay-command-fixture.ts';
8+
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
9+
import { maestroScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
10+
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
11+
import type { DaemonRequest } from '../../daemon-request.ts';
1212

1313
// A replay error raised before any step runs carries no `failure`, so the route
1414
// projects the normalized error directly instead of through the divergence

src/daemon/replay/internal/__tests__/session-replay-maestro-failure.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-maestro-failure.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { noMaestroIncludeSources } from '../../../../__tests__/test-utils/replay-script-source.ts';
1+
import { noMaestroIncludeSources } from '../../../__tests__/test-utils/replay-script-source.ts';
22
import { beforeEach, expect, test, vi } from 'vitest';
3-
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
3+
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
44

55
vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => {
66
const actual =
77
await importOriginal<typeof import('@agent-device/device-selection/dispatch-resolve')>();
88
return { ...actual, resolveTargetDevice: vi.fn() };
99
});
10-
vi.mock('../../../snapshot-interactor-capture.ts', () => ({
10+
vi.mock('../../snapshot-interactor-capture.ts', () => ({
1111
captureSnapshotWithInteractor: vi.fn(),
1212
}));
1313
import fs from 'node:fs';
@@ -23,19 +23,19 @@ import {
2323
import {
2424
buildTypedMaestroFailureReportProjection,
2525
buildTypedMaestroFailureResponse,
26-
} from '../session-replay-maestro-failure.ts';
27-
import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts';
28-
import { SessionStore } from '../../../session-store.ts';
29-
import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts';
30-
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
31-
import { baseReplayRequest as baseReq } from '../../__tests__/session-replay-runtime.fixtures.ts';
32-
import { replaySessionForTest } from './replay-session-fixture.ts';
26+
} from '../../replay/internal/session-replay-maestro-failure.ts';
27+
import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts';
28+
import { SessionStore } from '../../session-store.ts';
29+
import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts';
30+
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
31+
import { baseReplayRequest as baseReq } from '../../replay/__tests__/session-replay-runtime.fixtures.ts';
32+
import { replaySessionForTest } from '../../replay/internal/__tests__/replay-session-fixture.ts';
3333
import type { SnapshotNode } from '@agent-device/kernel/snapshot';
3434
import {
3535
captureSnapshotThroughLegacyDispatchFixture,
3636
legacyDispatchCapture,
37-
} from '../../../__tests__/legacy-snapshot-capture-fixture.ts';
38-
import { refFrameScope } from '../../../ref-frame.ts';
37+
} from '../legacy-snapshot-capture-fixture.ts';
38+
import { refFrameScope } from '../../ref-frame.ts';
3939

4040
const mockDispatchCommand = legacyDispatchCapture;
4141
const mockCaptureSnapshotWithInteractor = vi.mocked(captureSnapshotWithInteractor);

src/daemon/replay/internal/__tests__/session-replay-maestro-remote-evalscript.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-maestro-remote-evalscript.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import fs from 'node:fs';
22
import path from 'node:path';
33
import { describe, expect, test, vi } from 'vitest';
44
import { createScreenRecordingAdmissionLedger } from '@agent-device/capture-kit/screen-recording-admission-ledger';
5-
import { LeaseRegistry } from '../../../lease-registry.ts';
6-
import { platformResourceCleanup } from '../../../../platform-runtime-resource-cleanup.ts';
7-
import { SessionStore } from '../../../session-store.ts';
8-
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
9-
import { maestroScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
10-
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
11-
import type { DaemonRequest } from '../../../daemon-request.ts';
5+
import { LeaseRegistry } from '../../lease-registry.ts';
6+
import { platformResourceCleanup } from '../../../platform-runtime-resource-cleanup.ts';
7+
import { SessionStore } from '../../session-store.ts';
8+
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
9+
import { maestroScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
10+
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
11+
import type { DaemonRequest } from '../../daemon-request.ts';
1212
import {
1313
unavailableBindDevice,
1414
unavailableBindExactDevice,
15-
} from '../../../__tests__/test-device-runtime-gateway.ts';
15+
} from '../test-device-runtime-gateway.ts';
1616
import {
1717
handleReplayCommand,
1818
handleReplayTestCommand,
19-
} from '../../../handlers/session-replay-command.ts';
20-
import type { SessionCommandParams } from '../../../handlers/session-command-input.ts';
19+
} from '../../handlers/session-replay-command.ts';
20+
import type { SessionCommandParams } from '../../handlers/session-command-input.ts';
2121
import * as maestro from '@agent-device/maestro';
2222

2323
const spy = vi.spyOn(maestro, 'executeMaestroFlow');

src/daemon/replay/internal/__tests__/session-replay-maestro-session-address.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-maestro-session-address.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import fs from 'node:fs';
22
import path from 'node:path';
33
import { expect, test } from 'vitest';
44
import { stringify } from 'yaml';
5-
import { runTypedMaestroReplay } from '../session-replay-maestro-runtime.ts';
6-
import { SessionStore } from '../../../session-store.ts';
7-
import { replayCommandForTest } from '../../__tests__/replay-command-fixture.ts';
8-
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
9-
import { maestroScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
10-
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
11-
import type { DaemonRequest } from '../../../daemon-request.ts';
5+
import { runTypedMaestroReplay } from '../../replay/internal/session-replay-maestro-runtime.ts';
6+
import { SessionStore } from '../../session-store.ts';
7+
import { replayCommandForTest } from '../../replay/__tests__/replay-command-fixture.ts';
8+
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
9+
import { maestroScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
10+
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
11+
import type { DaemonRequest } from '../../daemon-request.ts';
1212

1313
// The Maestro replay route resolves the store key upstream and then validates the session's
1414
// selectors, so its conflict recovery must name that key too — an implicitly cwd-scoped session

src/daemon/replay/internal/__tests__/session-replay-runtime-maestro-dispatch.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-runtime-maestro-dispatch.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import assert from 'node:assert/strict';
33
import fs from 'node:fs';
44
import path from 'node:path';
55
import { test } from 'vitest';
6-
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
7-
import type { DaemonRequest, DaemonResponse } from '../../../daemon-request.ts';
8-
import { SessionStore } from '../../../session-store.ts';
9-
import { replayScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
10-
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
6+
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
7+
import type { DaemonRequest, DaemonResponse } from '../../daemon-request.ts';
8+
import { SessionStore } from '../../session-store.ts';
9+
import { replayScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
10+
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
1111

1212
const { runReplayFixture, runReplayForTest, assertNoUnresolvedInterpolation } =
1313
maestroReplayFixture;

src/daemon/replay/internal/__tests__/session-replay-runtime-maestro-keyboard.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-runtime-maestro-keyboard.test.ts

File renamed without changes.

src/daemon/replay/internal/__tests__/session-replay-runtime-maestro-run-flow.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-runtime-maestro-run-flow.test.ts

File renamed without changes.

src/daemon/replay/internal/__tests__/session-replay-runtime-maestro-run-script.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-runtime-maestro-run-script.test.ts

File renamed without changes.

src/daemon/replay/internal/__tests__/session-replay-runtime-maestro-shell-artifacts.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-runtime-maestro-shell-artifacts.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import assert from 'node:assert/strict';
33
import fs from 'node:fs';
44
import path from 'node:path';
55
import { test } from 'vitest';
6-
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
7-
import { SessionStore } from '../../../session-store.ts';
8-
import { replayScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
6+
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
7+
import { SessionStore } from '../../session-store.ts';
8+
import { replayScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
99

1010
const { runReplayFixture, runReplayForTest } = maestroReplayFixture;
1111

src/daemon/replay/internal/__tests__/session-replay-runtime-maestro-swipe.test.ts renamed to src/daemon/__tests__/replay-maestro/session-replay-runtime-maestro-swipe.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)