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 @@ -71,15 +71,21 @@ test('the tail follows a file its writer keeps appending to', async () => {
test('a tail whose file disappears stops on its own instead of throwing', async () => {
const logPath = logPathIn();
fs.writeFileSync(logPath, '');
const tail = tailRunnerLogFile({ file: { logPath, startOffset: 0 }, onOutput: () => {} });
const chunks: string[] = [];
const tail = tailRunnerLogFile({
file: { logPath, startOffset: 0 },
onOutput: (chunk) => chunks.push(chunk),
});
fs.rmSync(logPath);

await new Promise((resolve) => setTimeout(resolve, 120));
assert.deepEqual(chunks, []);

// Writing a fresh file must not restart a tail that already gave up.
fs.writeFileSync(logPath, 'AGENT_DEVICE_RUNNER_LISTENER_READY\n');
await new Promise((resolve) => setTimeout(resolve, 120));
tail.drain();
assert.deepEqual(chunks, []);
});

test('drain reads what the file gained and then stops following it', async () => {
Expand Down
16 changes: 14 additions & 2 deletions packages/platform-vega/src/inventory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
DeviceInventoryHostFor,
PlatformRequestScope,
} from '@agent-device/contracts/platform-runtime-host';
import { createVegaInventory, parseVegaDeviceList } from './inventory.ts';
import { createVegaInventory } from './inventory.ts';

const scope: PlatformRequestScope = {
signal: new AbortController().signal,
Expand All @@ -27,7 +27,19 @@ test('Vega inventory resolves the default CLI lazily and accepts only its virtua

const devices = await createVegaInventory(host).discover({}, scope);

assert.deepEqual(devices, parseVegaDeviceList('VirtualDevice : tv\n'));
// Spelled out rather than compared against `parseVegaDeviceList(...)`: using the parser as the
// expected value lets both sides move together, which is exactly how a dropped `physical` row or
// a wrong `kind`/`booted` mapping would stay invisible.
assert.deepEqual(devices, [
{
platform: 'vega',
id: 'VirtualDevice',
name: 'Vega Virtual Device (VirtualDevice)',
kind: 'emulator',
target: 'tv',
booted: true,
},
]);
});

test('Vega inventory fails closed when only an unsupported physical target is present', async () => {
Expand Down
Loading