From 4c2d8559f3296b44f4d4f9c1aafbfbe6a8137240 Mon Sep 17 00:00:00 2001 From: Enes Pekkaya Date: Fri, 4 Nov 2022 10:55:41 +0300 Subject: [PATCH 1/2] Fix not download files because of an early throw error. --- lib/schedule-run.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/schedule-run.js b/lib/schedule-run.js index a5c99f0..211b26e 100644 --- a/lib/schedule-run.js +++ b/lib/schedule-run.js @@ -164,7 +164,6 @@ exports.scheduleRun = async function (params) { ", " + err); } } - throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval); } run.downloaded_artifacts = await artifacts.getArtifact({file_artifacts: params.file_artifacts, @@ -172,5 +171,9 @@ exports.scheduleRun = async function (params) { log_artifacts: params.log_artifacts, arn: run.run.arn}); + if (run_status.run.result != "PASSED") { + throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval); + } + return run_status; } From c688ad1b77e764e3542b67e5785b530e80b3ee28 Mon Sep 17 00:00:00 2001 From: Enes Pekkaya Date: Fri, 4 Nov 2022 11:17:27 +0300 Subject: [PATCH 2/2] forgot to run build command --- test-application/dist/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test-application/dist/index.js b/test-application/dist/index.js index 720701c..db8371c 100644 --- a/test-application/dist/index.js +++ b/test-application/dist/index.js @@ -411,7 +411,6 @@ exports.scheduleRun = async function (params) { ", " + err); } } - throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval); } run.downloaded_artifacts = await artifacts.getArtifact({file_artifacts: params.file_artifacts, @@ -419,6 +418,10 @@ exports.scheduleRun = async function (params) { log_artifacts: params.log_artifacts, arn: run.run.arn}); + if (run_status.run.result != "PASSED") { + throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval); + } + return run_status; }