From 874fd5b952b6e75f643fb3f8abb473f76c68ef77 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Fri, 29 Sep 2017 11:23:27 +0200 Subject: [PATCH] Manage exceed maximum duration for our test --- build/saucelabs-unit-test.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build/saucelabs-unit-test.js b/build/saucelabs-unit-test.js index 7607b6d948..09096b1468 100644 --- a/build/saucelabs-unit-test.js +++ b/build/saucelabs-unit-test.js @@ -34,17 +34,25 @@ const waitingCallback = (error, body, id) => { }) }, 2000) } else { - const test = body['js tests'][0] - let passed = false + const test = body['js tests'][0] + let passed = false + let errorStr = false if (test.result !== null) { - passed = test.result.total === test.result.passed + if (typeof test.result === 'string' && test.result === 'Test exceeded maximum duration') { + errorStr = test.result + } else { + passed = test.result.total === test.result.passed + } } console.log(`Tested ${testURL}`) console.log(`Platform: ${test.platform.join(',')}`) console.log(`Passed: ${passed.toString()}`) console.log(`Url ${test.url} \n`) + if (errorStr) { + console.error(errorStr) + } if (passed) { jobsSuccess++