feat(gateway): stream release progress logs

This commit is contained in:
2026-08-09 09:50:06 +00:00
parent 73edd0230f
commit d01be27828
15 changed files with 619 additions and 31 deletions
+26
View File
@@ -40,4 +40,30 @@ describe('PnpmBuildRunner', () => {
expect(result.output.length).toBe(MAX_BUILD_OUTPUT_CHARS);
expect(result.output.endsWith('tail-marker')).toBe(true);
});
it('streams command boundaries and line-buffered output to an observer', async () => {
const runner = new PnpmBuildRunner();
const events: Array<{ type: string; message?: string }> = [];
const result = await runner.run(
[
{
command: process.execPath,
args: ['-e', "process.stdout.write('first\\npartial');"],
cwd: process.cwd(),
},
],
async (event) => {
events.push({ type: event.type, ...('message' in event ? { message: event.message } : {}) });
}
);
expect(result.ok).toBe(true);
expect(events).toEqual([
{ type: 'COMMAND_START' },
{ type: 'OUTPUT', message: 'first' },
{ type: 'OUTPUT', message: 'partial' },
{ type: 'COMMAND_END' },
]);
});
});