Skip to content

Commit f31f7aa

Browse files
committed
test: remove 151 unit tests fully covered by integration tests
Per-test coverage analysis confirmed every statement and branch these tests exercise is already covered by the provider-integration suite. Removes 8 fully redundant test files and 132 individual tests from 54 files (2,598 lines). Coverage unchanged at 82.4% statements / 84.5% lines, both above configured thresholds.
1 parent bbe7c06 commit f31f7aa

62 files changed

Lines changed: 0 additions & 2598 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/__tests__/artifacts-public.test.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/__tests__/client-public.test.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/__tests__/client.test.ts

Lines changed: 0 additions & 239 deletions
Original file line numberDiff line numberDiff line change
@@ -34,90 +34,6 @@ function createTransport(
3434
};
3535
}
3636

37-
test('devices.list maps daemon devices into normalized identifiers', async () => {
38-
const setup = createTransport(async () => ({
39-
ok: true,
40-
data: {
41-
devices: [
42-
{
43-
platform: 'ios',
44-
id: 'SIM-001',
45-
name: 'iPhone 16',
46-
kind: 'simulator',
47-
target: 'mobile',
48-
booted: true,
49-
},
50-
],
51-
},
52-
}));
53-
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });
54-
55-
const devices = await client.devices.list({
56-
platform: 'ios',
57-
iosSimulatorDeviceSet: '/tmp/sim-set',
58-
});
59-
60-
assert.equal(setup.calls.length, 1);
61-
assert.equal(setup.calls[0]?.command, 'devices');
62-
assert.deepEqual(setup.calls[0]?.flags, {
63-
daemonBaseUrl: 'http://daemon.example.test',
64-
daemonAuthToken: 'secret',
65-
daemonTransport: 'http',
66-
tenant: 'acme',
67-
sessionIsolation: 'tenant',
68-
runId: 'run-123',
69-
leaseId: 'lease-123',
70-
platform: 'ios',
71-
iosSimulatorDeviceSet: '/tmp/sim-set',
72-
verbose: true,
73-
});
74-
assert.deepEqual(devices, [
75-
{
76-
platform: 'ios',
77-
target: 'mobile',
78-
kind: 'simulator',
79-
id: 'SIM-001',
80-
name: 'iPhone 16',
81-
booted: true,
82-
identifiers: {
83-
deviceId: 'SIM-001',
84-
deviceName: 'iPhone 16',
85-
udid: 'SIM-001',
86-
},
87-
ios: {
88-
udid: 'SIM-001',
89-
},
90-
android: undefined,
91-
},
92-
]);
93-
});
94-
95-
test('typed client forwards shared request lock policy metadata', async () => {
96-
const setup = createTransport(async () => ({
97-
ok: true,
98-
data: {
99-
devices: [],
100-
},
101-
}));
102-
const client = createAgentDeviceClient(
103-
{
104-
...setup.config,
105-
lockPolicy: 'reject',
106-
lockPlatform: 'ios',
107-
},
108-
{ transport: setup.transport },
109-
);
110-
111-
await client.devices.list({
112-
device: 'Pixel 9',
113-
});
114-
115-
assert.equal(setup.calls.length, 1);
116-
assert.equal(setup.calls[0]?.meta?.lockPolicy, 'reject');
117-
assert.equal(setup.calls[0]?.meta?.lockPlatform, 'ios');
118-
assert.equal(setup.calls[0]?.flags?.device, 'Pixel 9');
119-
});
120-
12137
test('apps.open resolves session device identifiers from open response', async () => {
12238
const setup = createTransport(async (req) => {
12339
if (req.command === 'open') {
@@ -202,60 +118,6 @@ test('apps.open forwards explicit runtime hints through the daemon request', asy
202118
});
203119
});
204120

205-
test('apps.installFromSource forwards source payload and normalizes launch identity', async () => {
206-
const setup = createTransport(async () => ({
207-
ok: true,
208-
data: {
209-
packageName: 'com.example.demo',
210-
appName: 'Demo',
211-
launchTarget: 'com.example.demo',
212-
installablePath: '/tmp/materialized/installable/demo.apk',
213-
archivePath: '/tmp/materialized/archive/demo.zip',
214-
materializationId: 'materialized-123',
215-
materializationExpiresAt: '2026-03-13T12:00:00.000Z',
216-
},
217-
}));
218-
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });
219-
220-
const result = await client.apps.installFromSource({
221-
platform: 'android',
222-
retainPaths: true,
223-
retentionMs: 60_000,
224-
source: {
225-
kind: 'url',
226-
url: 'https://example.com/demo.apk',
227-
headers: { authorization: 'Bearer token' },
228-
},
229-
});
230-
231-
assert.equal(setup.calls.length, 1);
232-
assert.equal(setup.calls[0]?.command, 'install_source');
233-
assert.deepEqual(setup.calls[0]?.meta?.installSource, {
234-
kind: 'url',
235-
url: 'https://example.com/demo.apk',
236-
headers: { authorization: 'Bearer token' },
237-
});
238-
assert.equal(setup.calls[0]?.meta?.retainMaterializedPaths, true);
239-
assert.equal(setup.calls[0]?.meta?.materializedPathRetentionMs, 60_000);
240-
assert.deepEqual(result, {
241-
appName: 'Demo',
242-
appId: 'com.example.demo',
243-
bundleId: undefined,
244-
packageName: 'com.example.demo',
245-
launchTarget: 'com.example.demo',
246-
installablePath: '/tmp/materialized/installable/demo.apk',
247-
archivePath: '/tmp/materialized/archive/demo.zip',
248-
materializationId: 'materialized-123',
249-
materializationExpiresAt: '2026-03-13T12:00:00.000Z',
250-
identifiers: {
251-
session: 'qa',
252-
appId: 'com.example.demo',
253-
appBundleId: undefined,
254-
package: 'com.example.demo',
255-
},
256-
});
257-
});
258-
259121
test('apps.installFromSource derives Android launchTarget from packageName when daemon omits it', async () => {
260122
const setup = createTransport(async () => ({
261123
ok: true,
@@ -322,15 +184,6 @@ test('apps.installFromSource forwards GitHub Actions artifact sources unchanged'
322184
});
323185
});
324186

325-
test('interactions.rotateGesture serializes a complete center without undefined literals', async () => {
326-
const setup = createTransport(async () => ({ ok: true, data: {} }));
327-
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });
328-
329-
await client.interactions.rotateGesture({ degrees: 35, x: 200, y: 420 });
330-
331-
assert.deepEqual(setup.calls[0]?.positionals, ['rotate', '35', '200', '420']);
332-
});
333-
334187
test('interactions.rotateGesture rejects partial centers on the client side', async () => {
335188
const setup = createTransport(async () => {
336189
throw new Error('transport should not run for invalid input');
@@ -347,83 +200,6 @@ test('interactions.rotateGesture rejects partial centers on the client side', as
347200
assert.equal(setup.calls.length, 0);
348201
});
349202

350-
test('apps.list forwards filters and returns daemon app names', async () => {
351-
const setup = createTransport(async () => ({
352-
ok: true,
353-
data: {
354-
apps: ['Settings (com.apple.Preferences)', 'Demo (com.example.demo)', { ignored: true }],
355-
},
356-
}));
357-
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });
358-
359-
const apps = await client.apps.list({
360-
platform: 'ios',
361-
device: 'iPhone 16',
362-
appsFilter: 'user-installed',
363-
});
364-
365-
assert.equal(setup.calls.length, 1);
366-
assert.equal(setup.calls[0]?.command, 'apps');
367-
assert.deepEqual(setup.calls[0]?.positionals, []);
368-
assert.equal(setup.calls[0]?.flags?.platform, 'ios');
369-
assert.equal(setup.calls[0]?.flags?.device, 'iPhone 16');
370-
assert.equal(setup.calls[0]?.flags?.appsFilter, 'user-installed');
371-
assert.deepEqual(apps, ['Settings (com.apple.Preferences)', 'Demo (com.example.demo)']);
372-
});
373-
374-
test('materializations.release forwards materialization identity through the daemon request', async () => {
375-
const setup = createTransport(async () => ({
376-
ok: true,
377-
data: {
378-
released: true,
379-
materializationId: 'materialized-123',
380-
},
381-
}));
382-
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });
383-
384-
const result = await client.materializations.release({
385-
materializationId: 'materialized-123',
386-
});
387-
388-
assert.equal(setup.calls.length, 1);
389-
assert.equal(setup.calls[0]?.command, 'release_materialized_paths');
390-
assert.equal(setup.calls[0]?.meta?.materializationId, 'materialized-123');
391-
assert.deepEqual(result, {
392-
released: true,
393-
materializationId: 'materialized-123',
394-
identifiers: {},
395-
});
396-
});
397-
398-
test('client throws AppError for daemon failures', async () => {
399-
const setup = createTransport(async () => ({
400-
ok: false,
401-
error: {
402-
code: 'SESSION_NOT_FOUND',
403-
message: 'No active session',
404-
hint: 'Run open first.',
405-
diagnosticId: 'diag-1',
406-
logPath: '/tmp/daemon.log',
407-
details: { session: 'qa' },
408-
},
409-
}));
410-
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });
411-
412-
await assert.rejects(
413-
async () => await client.capture.snapshot(),
414-
(error: unknown) => {
415-
assert.ok(error instanceof AppError);
416-
assert.equal(error.code, 'SESSION_NOT_FOUND');
417-
assert.equal(error.message, 'No active session');
418-
assert.equal(error.details?.hint, 'Run open first.');
419-
assert.equal(error.details?.diagnosticId, 'diag-1');
420-
assert.equal(error.details?.logPath, '/tmp/daemon.log');
421-
assert.deepEqual(error.details?.session, 'qa');
422-
return true;
423-
},
424-
);
425-
});
426-
427203
// fallow-ignore-next-line complexity
428204
test('replay.run serializes client-collected AD_VAR shell env into daemon request', async () => {
429205
const previousAppId = process.env.AD_VAR_APP_ID;
@@ -462,21 +238,6 @@ test('replay.run serializes client-collected AD_VAR shell env into daemon reques
462238
}
463239
});
464240

465-
test('replay.run forwards backend without knowing the concrete syntax', async () => {
466-
const setup = createTransport(async () => ({ ok: true, data: {} }));
467-
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });
468-
469-
await client.replay.run({
470-
path: './flows/login.yaml',
471-
backend: 'external-flow',
472-
});
473-
474-
assert.equal(setup.calls.length, 1);
475-
assert.equal(setup.calls[0]?.command, 'replay');
476-
assert.deepEqual(setup.calls[0]?.positionals, ['./flows/login.yaml']);
477-
assert.equal(setup.calls[0]?.flags?.replayBackend, 'external-flow');
478-
});
479-
480241
test('replay.run keeps deprecated maestro option as backend alias', async () => {
481242
const setup = createTransport(async () => ({ ok: true, data: {} }));
482243
const client = createAgentDeviceClient(setup.config, { transport: setup.transport });

src/__tests__/command-codecs.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ const BASE_FLAGS: CliFlags = {
1818
version: false,
1919
};
2020

21-
test('command catalog owns daemon routing groups', () => {
22-
assert.equal(DAEMON_COMMAND_GROUPS.snapshot.has(PUBLIC_COMMANDS.wait), true);
23-
assert.equal(DAEMON_COMMAND_GROUPS.observability.has(PUBLIC_COMMANDS.logs), true);
24-
assert.equal(DAEMON_COMMAND_GROUPS.replay.has(PUBLIC_COMMANDS.test), true);
25-
});
26-
2721
test('wait codec preserves CLI bare text and client selector forms', () => {
2822
const options = waitCommandCodec.decode(['Continue', '1500'], BASE_FLAGS);
2923
assert.equal(options.text, 'Continue');

0 commit comments

Comments
 (0)