Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate CI test output into a single string #8489

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 6 additions & 8 deletions scripts/run_tests_in_ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ const argv = yargs.options({
const dir = path.resolve(myPath);
const { name } = require(`${dir}/package.json`);

let stdout = '';
let stderr = '';
let testProcessOutput = '';
try {
if (process.env?.BROWSERS) {
for (const package in crossBrowserPackages) {
Expand All @@ -74,27 +73,26 @@ const argv = yargs.options({
const testProcess = spawn('yarn', ['--cwd', dir, scriptName]);

testProcess.childProcess.stdout.on('data', data => {
stdout += data.toString();
testProcessOutput += '[stdout]' + data.toString();
});
testProcess.childProcess.stderr.on('data', data => {
stderr += data.toString();
testProcessOutput += '[stderr]' + data.toString();
});

await testProcess;
console.log('Success: ' + name);
writeLogs('Success', name, stdout + '\n' + stderr);
writeLogs('Success', name, testProcessOutput);
} catch (e) {
console.error('Failure: ' + name);
console.log(stdout);
console.error(stderr);
console.error(testProcessOutput);

if (process.env.CHROME_VERSION_NOTES) {
console.error();
console.error(process.env.CHROME_VERSION_NOTES);
console.error();
}

writeLogs('Failure', name, stdout + '\n' + stderr);
writeLogs('Failure', name, testProcessOutput);

process.exit(1);
}
Expand Down
Loading