Skip to content

Commit

Permalink
chore: log exit code if available
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed Oct 18, 2022
1 parent bf31f78 commit c332335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/src/plugins/kubernetes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ async function runWithoutArtifacts({
startedAt,
completedAt: new Date(),
command: [...(command || []), ...(args || [])],
exitCode: err.detail.exitCode,
}
} else {
throw err
Expand Down Expand Up @@ -624,6 +625,7 @@ ${cmd.join(" ")}
startedAt,
completedAt: new Date(),
command: cmd,
exitCode: res.exitCode,
}
} else {
throw err
Expand Down
5 changes: 4 additions & 1 deletion core/src/tasks/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,11 @@ export class TestTask extends BaseTask {
append: true,
})
} else {
const msg = !!result.exitCode
? `Failed with code ${result.exitCode}! (took ${log.getDuration(1)} sec)`
: `Failed! (took ${log.getDuration(1)} sec)`
log.setError({
msg: chalk.red(`Failed! (took ${log.getDuration(1)} sec)`),
msg,
append: true,
})
throw new TestError(result.log)
Expand Down

0 comments on commit c332335

Please sign in to comment.