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
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import path from 'node:path';
import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir';
import { AppError } from '@agent-device/kernel/errors';

vi.mock('../metro/client-metro-companion.ts', () => ({
vi.mock('./client-metro-companion.ts', () => ({
ensureMetroCompanion: vi.fn(),
}));

import { ensureMetroCompanion } from '../metro/client-metro-companion.ts';
import { prepareMetroRuntime } from '../metro/client-metro.ts';
import { ensureMetroCompanion } from './client-metro-companion.ts';
import { prepareMetroRuntime } from './client-metro.ts';

const TEST_BRIDGE_SCOPE = {
tenantId: 'tenant-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
type ConfirmedProcessStop,
} from '@agent-device/host-kit/process';

import { ensureMetroCompanion, stopMetroCompanion } from '../metro/client-metro-companion.ts';
import { ensureMetroCompanion, stopMetroCompanion } from './client-metro-companion.ts';
import { ensureReactDevtoolsCompanion } from '../client/client-react-devtools-companion.ts';
import { METRO_COMPANION_RUN_ARG } from '../client/client-companion-tunnel-contract.ts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
type ConfirmedProcessStop,
} from '@agent-device/host-kit/process';

import { prepareMetroRuntime } from '../metro/client-metro.ts';
import { prepareMetroRuntime } from './client-metro.ts';

afterEach(() => {
vi.useRealTimers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { createServer } from 'node:http';
import type { Socket } from 'node:net';
import net from 'node:net';
import path from 'node:path';
import { prepareMetroRuntime, reloadMetro } from '../metro/client-metro.ts';
import { resolveMetroReloadEndpoints } from '../metro/metro-reload-endpoints.ts';
import { prepareMetroRuntime, reloadMetro } from './client-metro.ts';
import { resolveMetroReloadEndpoints } from './metro-reload-endpoints.ts';
import { createAgentDeviceClient } from '../agent-device-client.ts';
import { readMetroSessionHints } from '../metro/metro-session-hints.ts';
import { readMetroSessionHints } from './metro-session-hints.ts';
import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution';
import { AppError } from '@agent-device/kernel/errors';
import { isProcessAlive, waitForProcessExit } from '@agent-device/host-kit/process';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
clearMetroSessionHints,
readMetroSessionHints,
writeMetroSessionHints,
} from '../metro/metro-session-hints.ts';
} from './metro-session-hints.ts';
import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir';

function tempStateDir(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { test } from 'vitest';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { resolveRemoteConfigProfile } from '../remote/remote-config.ts';
import { resolveRemoteConfigPath } from '../remote/remote-config-core.ts';
import { resolveRemoteConfigProfile } from '../remote-config.ts';
import { resolveRemoteConfigPath } from '../remote-config-core.ts';
import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir';

test('public remote-config helpers resolve file paths and merged profiles', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import fs from 'node:fs';
import http, { type IncomingMessage, type ServerResponse } from 'node:http';
import path from 'node:path';
import { once } from 'node:events';
import { uploadArtifact } from '../remote/upload-client.ts';
import { uploadArtifact } from '../upload-client.ts';
import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir';

const TEST_TOKEN = 'agent-device-upload-cancel-token';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { createHash, randomUUID } from 'node:crypto';
import fs from 'node:fs';
import http, { type IncomingMessage, type ServerResponse } from 'node:http';
import path from 'node:path';
import { uploadArtifact } from '../remote/upload-client.ts';
import type { UploadProgressEvent } from '../remote/upload-progress.ts';
import { uploadArtifact } from '../upload-client.ts';
import type { UploadProgressEvent } from '../upload-progress.ts';
import { runCmdSync, withCommandExecutorOverride } from '@agent-device/host-kit/command';
import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir';
import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit/loopback';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
import { test } from 'vitest';

test('public android-adb entrypoint exposes helpers but not resolver internals', async () => {
const androidAdb = await import('../sdk/android-adb.ts');
const androidAdb = await import('./android-adb.ts');

assert.equal(typeof androidAdb.createAndroidPortReverseManager, 'function');
assert.equal(typeof androidAdb.captureAndroidLogcatWithAdb, 'function');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from 'vitest';
import assert from 'node:assert/strict';
import { runBatch } from '../../sdk/batch.ts';
import { runBatch } from './batch.ts';
import type { DaemonRequest } from '@agent-device/kernel/contracts';

test('public batch entrypoint exports daemon-compatible orchestration helpers', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ import fs from 'node:fs';
import path from 'node:path';
import { test } from 'vitest';
import type { CommandResult } from '@agent-device/command-registry/command-result';
import {
centerOfRect,
defaultHintForCode,
normalizeError,
type DaemonError,
} from '../sdk/contracts.ts';
import { AppError } from '../sdk/index.ts';
import { centerOfRect, defaultHintForCode, normalizeError, type DaemonError } from './contracts.ts';
import { AppError } from './index.ts';

const invalidArgsCode = 'INVALID_ARGS' satisfies AppErrorCode;
const rect = { x: 1, y: 2, width: 3, height: 4 } satisfies Rect;
Expand All @@ -53,7 +48,7 @@ test('public contracts error helpers do not load diagnostics module', () => {
});

test('public contract facade does not expose parser schemas', async () => {
const publicContracts = (await import('../sdk/contracts.ts')) as Record<string, unknown>;
const publicContracts = (await import('./contracts.ts')) as Record<string, unknown>;

assert.equal(publicContracts.daemonCommandRequestSchema, undefined);
assert.equal(publicContracts.daemonRuntimeSchema, undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type MetroBridgeDescriptor,
type MetroTunnelRequestMessage,
type MetroTunnelResponseMessage,
} from '../sdk/metro.ts';
} from './metro.ts';

test('public metro entrypoint exposes url and transport helpers', () => {
assert.equal(normalizeBaseUrl('https://bridge.example.test///'), 'https://bridge.example.test');
Expand All @@ -29,7 +29,7 @@ test('public metro entrypoint exposes url and transport helpers', () => {
});

test('public metro entrypoint does not expose runtime hint builders', async () => {
const metro = (await import('../sdk/metro.ts')) as Record<string, unknown>;
const metro = (await import('./metro.ts')) as Record<string, unknown>;

assert.equal(metro.buildIosRuntimeHints, undefined);
assert.equal(metro.buildAndroidRuntimeHints, undefined);
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import slowTestGateReporter from './scripts/vitest-slow-test-reporter.ts';
// mutation lane excludes these tests even though the unit lane runs them normally.
const MUTATION_EXCLUDED_SUBPROCESS_TESTS: readonly string[] = [
// Stubs npx plus the package managers and spawns a real Metro dev server per case.
'src/__tests__/client-metro.test.ts',
'src/metro/client-metro.test.ts',
// The SUT is the subprocess watchdog: a node subprocess per case, one hangs on purpose (#1414).
'scripts/fuzz/harness.test.ts',
// The daemon takeover test launches a branch-named daemon per case to prove
Expand Down
Loading