Skip to content

Commit

Permalink
improvement(exec): show test and task logs when log level is verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 committed May 18, 2021
1 parent 72165da commit 9fd19af
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/src/plugins/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ export async function testExecModule({

await copyArtifacts(log, test.config.spec.artifacts, module.buildPath, artifactsPath)

const outputLog = (result.stdout + result.stderr).trim()
if (outputLog) {
const prefix = `Finished running test ${chalk.white(test.name)}. Here is the output:`
log.verbose(renderMessageWithDivider(prefix, outputLog, false, chalk.gray))
}

return {
moduleName: module.name,
command,
Expand All @@ -279,7 +285,7 @@ export async function testExecModule({
success: result.exitCode === 0,
startedAt,
completedAt: new Date(),
log: result.stdout + result.stderr,
log: outputLog,
}
}

Expand Down Expand Up @@ -313,6 +319,11 @@ export async function runExecTask(params: RunTaskParams<ExecModule>): Promise<Ru
outputLog = ""
}

if (outputLog) {
const prefix = `Finished running task ${chalk.white(task.name)}. Here is the output:`
log.verbose(renderMessageWithDivider(prefix, outputLog, false, chalk.gray))
}

await copyArtifacts(log, task.spec.artifacts, module.buildPath, artifactsPath)

return {
Expand Down

0 comments on commit 9fd19af

Please sign in to comment.