Skip to content

Commit e2ad807

Browse files
committed
test(android): name the collected path a scoped pull lands on
The scenario asserted the pull targeted the caller's own path, which is exactly the claim ADR 0024 2.3 retired. It now names the collected sibling and checks the real host afterwards: the caller's video is there, and the copy the stop made is not.
1 parent 46a8824 commit e2ad807

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎test/integration/provider-scenarios/android-recording.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import assert from 'node:assert/strict';
22
import fs from 'node:fs';
33
import path from 'node:path';
44
import { test } from 'vitest';
5+
import { collectedRecordingPath } from '@agent-device/capture-kit/recording-stop-sequence';
56
import { assertRpcError, assertRpcOk } from './assertions.ts';
67
import { ANDROID_RECORDING_CONTRACT_EVIDENCE } from './android-recording.coverage.ts';
78
import { PROVIDER_SCENARIO_ANDROID } from './fixtures.ts';
@@ -45,8 +46,11 @@ test(ANDROID_RECORDING_CONTRACT_EVIDENCE.testName, async () => {
4546
assert.ok(calls.some((args) => args[1]?.startsWith('screenrecord --bit-rate 20000000 ')));
4647
assert.ok(calls.some((args) => args.join(' ') === 'shell kill -2 4321'));
4748
assert.equal(pulls.length, 1);
48-
assert.equal(pulls[0]?.localPath, outputPath);
49+
// The recorder's chunks land on a collected sibling and the caller's path is written from a
50+
// copy of them, which is what lets a failed stop leave the export absent (ADR 0024 2.3).
51+
assert.equal(pulls[0]?.localPath, collectedRecordingPath(outputPath));
4952
assert.equal(fs.existsSync(outputPath), true);
53+
assert.equal(fs.existsSync(collectedRecordingPath(outputPath)), false);
5054
} finally {
5155
await daemon.close();
5256
}
@@ -82,7 +86,8 @@ test('Provider-backed integration Android record stop reattaches a matching dura
8286
calls.some((args) => args[1]?.includes('/sdcard/agent-device-recording-active.json')),
8387
);
8488
assert.ok(calls.some((args) => args.join(' ') === 'shell kill -2 4321'));
85-
assert.deepEqual(pulls, [{ remotePath, localPath: outputPath }]);
89+
assert.deepEqual(pulls, [{ remotePath, localPath: collectedRecordingPath(outputPath) }]);
90+
assert.equal(fs.existsSync(outputPath), true);
8691
} finally {
8792
await daemon.close();
8893
}

0 commit comments

Comments
 (0)