From 34c6653877897ce44180503608414fe1764a7fae Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Wed, 8 Jul 2026 17:33:10 -0400 Subject: [PATCH] last exit info formatting --- playlet-app/src/source/Logger.bs | 10 ++++------ tools/run-test-app.js | 9 +++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/playlet-app/src/source/Logger.bs b/playlet-app/src/source/Logger.bs index 69a7ed50..9bd6bfe2 100644 --- a/playlet-app/src/source/Logger.bs +++ b/playlet-app/src/source/Logger.bs @@ -28,12 +28,10 @@ namespace Logger msg += `media_player_state: ${lastExitInfo.media_player_state}\n` msg += `mem_limit: ${lastExitInfo.mem_limit}\n` - ' Sometimes lastExitInfo.console_log would contain 'AppExitComplete', which - ' is used to detect test runner exits. So we don't log it in test mode. - #if TEST_MODE - #else - msg += `console_log:\n${lastExitInfo.console_log}\n` - #end if + ' The echo is the PREVIOUS run's console — '| ' marks each line so consumers can skip it + ' when scanning live output. + consoleLog = `${lastExitInfo.console_log}` + msg += `console_log:\n| ` + consoleLog.Replace(chr(10), `\n| `) + `\n` msg += `********** End Last Exit Info **********\n` diff --git a/tools/run-test-app.js b/tools/run-test-app.js index f93a9679..23c8f71f 100644 --- a/tools/run-test-app.js +++ b/tools/run-test-app.js @@ -79,7 +79,7 @@ process.on('uncaughtException', (error, origin) => { await rokuDeploy.publish(options); console.log('Waiting for test to finish'); - let data = await readFromTelnetUntil(telnet, timeout); + let data = withoutQuotedLines(await readFromTelnetUntil(telnet, timeout)); if (reportOnly) { data = parseTestReport(data); @@ -132,6 +132,11 @@ function startTelnetClientAsync(host, port, timeoutSeconds = 2) { }); } +// Lines starting with '| ' are the app quoting the previous run's console (Last Exit Info), not live output. +function withoutQuotedLines(text) { + return text.split('\n').filter((line) => !line.startsWith('| ')).join('\n'); +} + function readFromTelnetUntil(connection, timeoutSeconds = 20, endToken = 'AppExitComplete') { return new Promise((resolve, reject) => { let data = ''; @@ -148,7 +153,7 @@ function readFromTelnetUntil(connection, timeoutSeconds = 20, endToken = 'AppExi clearTimeout(timeoutID); data += chunk.toString(); - if (data.includes(endToken)) { + if (withoutQuotedLines(data).includes(endToken)) { resolve(data); connection.end(); return;