fix(cli): auto-install runtime during setup (#116)

* fix(cli): auto-install runtime during setup

* test: align docs smoke with readme
This commit is contained in:
Andrey Avtomonov 2026-05-16 11:39:43 +02:00 committed by GitHub
parent 42b688e934
commit a72fca2b32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 131 additions and 23 deletions

View file

@ -994,6 +994,37 @@ describe('runContextBuild', () => {
);
});
it('threads the original runtime IO into captured target execution', async () => {
const io = makeIo({ isTTY: true });
const project = projectWithConnections({
warehouse: { driver: 'postgres', context: { queryHistory: { enabled: true } } },
});
const executeTarget = vi.fn(async (target) => successResult(target.connectionId, target.driver, target.operation));
await runContextBuild(
project,
{
projectDir: '/tmp/project',
inputMode: 'auto',
cliVersion: '0.2.0',
runtimeInstallPolicy: 'auto',
},
io.io,
{ executeTarget, now: () => 1000 },
);
expect(executeTarget).toHaveBeenCalledWith(
expect.objectContaining({ connectionId: 'warehouse' }),
expect.objectContaining({ runtimeInstallPolicy: 'auto' }),
expect.objectContaining({
stdout: expect.objectContaining({ isTTY: false }),
}),
expect.objectContaining({
runtimeIo: io.io,
}),
);
});
it('calls onSourceProgress when sources start and finish', async () => {
const io = makeIo();
const project = projectWithConnections({