Skip to content
Open
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
29 changes: 14 additions & 15 deletions src/objects/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,20 @@ export class Execution {
}
}

// Doesn't work as expected, the execution is killed when the stdin is sent.
// /**
// * Send input to the execution's stdin.
// *
// * @param input - The input to send
// * @param options - Request options
// */
// async sendStdIn(input: string, options?: Core.RequestOptions): Promise<void> {
// await this.client.devboxes.executions.sendStdIn(
// this._devboxId,
// this._executionId,
// { text: input },
// options,
// );
// }
/**
* Send input to the execution's stdin.
*
* @param input - The input to send
* @param options - Request options
*/
async sendStdIn(input: string, options?: Core.RequestOptions): Promise<void> {
await this.client.devboxes.executions.sendStdIn(
this._devboxId,
this._executionId,
{ text: input },
options,
);
}

/**
* Wait for the execution to complete and return the result.
Expand Down
10 changes: 3 additions & 7 deletions tests/smoketests/object-oriented/execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('smoketest: object-oriented execution', () => {
}
});

test.skip('start execution with stdin enabled', async () => {
test('start execution with stdin enabled', async () => {
expect(devbox).toBeDefined();
execution = await devbox.cmd.execAsync({
command: 'cat',
Expand All @@ -101,14 +101,10 @@ describe('smoketest: object-oriented execution', () => {
expect((await execution.getState()).status).toBe('running');
});

test.skip('send input to execution', async () => {
test('send input to execution', async () => {
expect(execution).toBeDefined();
expect((await execution.getState()).status).toBe('running');
try {
//await execution.sendStdIn('Hello from stdin!\n');
} catch (error) {
console.error('Error sending input to execution:', error);
}
await execution.sendStdIn('Hello from stdin!\n');

// Wait a bit for the input to be processed
await new Promise((resolve) => setTimeout(resolve, 1000));
Expand Down
Loading