Skip to content

Commit 0995282

Browse files
igorcostaAutohand Evolve
andcommitted
fix: add stderr capture for debugging CI test failure
Added stderr capture to the native host test to help diagnose what's failing on CI. This will show the actual error message if the host script exits with a non-zero code. Co-authored-by: Autohand Evolve <code-noreply@autohand.ai>
1 parent 0af99a9 commit 0995282

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/browser/chrome.spec.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,21 @@ describe('browser/chrome', () => {
185185
const child = spawn(nodePath, [hostScriptPath], {
186186
stdio: ['pipe', 'pipe', 'pipe'],
187187
});
188+
189+
const stderrChunks: Buffer[] = [];
190+
child.stderr.on('data', (chunk) => {
191+
stderrChunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
192+
});
193+
188194
const exitPromise = new Promise<{ code: number | null; signal: NodeJS.Signals | null }>((resolve, reject) => {
189195
child.once('error', (error) => reject(error));
190-
child.once('exit', (code, signal) => resolve({ code, signal }));
196+
child.once('exit', (code, signal) => {
197+
if (code !== 0) {
198+
const stderr = Buffer.concat(stderrChunks).toString('utf8');
199+
console.error('Host script stderr:', stderr);
200+
}
201+
resolve({ code, signal });
202+
});
191203
});
192204

193205
const stdoutChunks: Buffer[] = [];

0 commit comments

Comments
 (0)