From c332335644148fcca6f95a9b244a6e6ad8d92832 Mon Sep 17 00:00:00 2001 From: Vladimir Vagaytsev Date: Tue, 18 Oct 2022 12:03:35 +0200 Subject: [PATCH] chore: log exit code if available --- core/src/plugins/kubernetes/run.ts | 2 ++ core/src/tasks/test.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/plugins/kubernetes/run.ts b/core/src/plugins/kubernetes/run.ts index d27ab85a16..e43f5e062a 100644 --- a/core/src/plugins/kubernetes/run.ts +++ b/core/src/plugins/kubernetes/run.ts @@ -440,6 +440,7 @@ async function runWithoutArtifacts({ startedAt, completedAt: new Date(), command: [...(command || []), ...(args || [])], + exitCode: err.detail.exitCode, } } else { throw err @@ -624,6 +625,7 @@ ${cmd.join(" ")} startedAt, completedAt: new Date(), command: cmd, + exitCode: res.exitCode, } } else { throw err diff --git a/core/src/tasks/test.ts b/core/src/tasks/test.ts index b480303875..f0ef95a01c 100644 --- a/core/src/tasks/test.ts +++ b/core/src/tasks/test.ts @@ -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)