Skip to content

Commit

Permalink
chore(internal): adjust ecosystem-tests logging in CI (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Jan 23, 2024
1 parent e1fbc39 commit 156084b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ecosystem-tests/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import path from 'path';

const TAR_NAME = 'openai.tgz';
const PACK_FILE = `.pack/${TAR_NAME}`;
const IS_CI = Boolean(process.env['CI'] && process.env['CI'] !== 'false');

async function defaultNodeRunner() {
await installPackage();
Expand Down Expand Up @@ -249,10 +250,11 @@ async function main() {
runningProjects.delete(project);
}

for (const { dest, data } of chunks) {
if (dest === 'stdout') process.stdout.write(data);
else process.stderr.write(data);
if (IS_CI) console.log(`::group::${failed.includes(project) ? '❌' : '✅'} ${project}`);
for (const { data } of chunks) {
process.stdout.write(data);
}
if (IS_CI) console.log('::endgroup::');
}
}),
);
Expand All @@ -271,15 +273,15 @@ async function main() {
try {
await withRetry(fn, project, state.retry);
console.error('\n');
console.error(banner(`✅ ${project}`));
console.error(`✅ ${project}`);
} catch (err) {
if (err && (err as any).shortMessage) {
console.error((err as any).shortMessage);
} else {
console.error(err);
}
console.error('\n');
console.error(banner(`❌ ${project}`));
console.error(`❌ ${project}`);
failed.push(project);
}
console.error('\n');
Expand Down

0 comments on commit 156084b

Please sign in to comment.