Skip to content

Commit 7b9a912

Browse files
authored
Merge pull request #12 from espekkaya/master
Fix not download files because of an early throw error.
2 parents c929c9a + c688ad1 commit 7b9a912

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/schedule-run.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,16 @@ exports.scheduleRun = async function (params) {
164164
", " + err);
165165
}
166166
}
167-
throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval);
168167
}
169168

170169
run.downloaded_artifacts = await artifacts.getArtifact({file_artifacts: params.file_artifacts,
171170
screenshot_artifacts: params.screenshot_artifacts,
172171
log_artifacts: params.log_artifacts,
173172
arn: run.run.arn});
174173

174+
if (run_status.run.result != "PASSED") {
175+
throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval);
176+
}
177+
175178
return run_status;
176179
}

test-application/dist/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,17 @@ exports.scheduleRun = async function (params) {
411411
", " + err);
412412
}
413413
}
414-
throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval);
415414
}
416415

417416
run.downloaded_artifacts = await artifacts.getArtifact({file_artifacts: params.file_artifacts,
418417
screenshot_artifacts: params.screenshot_artifacts,
419418
log_artifacts: params.log_artifacts,
420419
arn: run.run.arn});
421420

421+
if (run_status.run.result != "PASSED") {
422+
throw("Test run failed after " + i*wait_interval + " seconds with: " + run_status.run.resultCode + ". Timeout is set to " + max_wait*wait_interval);
423+
}
424+
422425
return run_status;
423426
}
424427

0 commit comments

Comments
 (0)