From 0beec633671d7075a9dc64d1256c5a8a9195485a Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 9 Feb 2017 18:28:33 +0100 Subject: [PATCH] Ensure Gemini terminates with exit status 1 on failing build --- .travis.yml | 2 +- lib/tasks/tests/visual/run.js | 12 +++++++++--- tests/visual/config/gemini.sauce-connect.json | 10 +++++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52e4fa40c..74e028f6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ matrix: env: - CXX=g++-4.8 install: yarn install - script: yarn run test:visual:run --no-clean + script: yarn run test:visual:run -- --no-clean # Limit clone depth to 5, to speed up build git: diff --git a/lib/tasks/tests/visual/run.js b/lib/tasks/tests/visual/run.js index 1c09af9e3..639c1d8be 100644 --- a/lib/tasks/tests/visual/run.js +++ b/lib/tasks/tests/visual/run.js @@ -39,6 +39,7 @@ export default (gulp, config, args) => { return done => { /* Start static file server */ + let error = false new Promise(resolve => { ecstatic.start(`${config.tests.visual}/data`, 8000, resolve) @@ -96,7 +97,8 @@ export default (gulp, config, args) => { }) /* Return runner for graceful stop */ - .then(() => { + .then(status => { + error = status.errored > 0 return runner }) }) @@ -111,9 +113,13 @@ export default (gulp, config, args) => { /* Stop static file server */ }) .then(() => { - ecstatic.stop(done) + ecstatic.stop(() => { + return error + ? done(new Error("Gemini terminated with errors")) + : done() + }) }, err => { - return done(err) + return done(new Error(err)) }) } } diff --git a/tests/visual/config/gemini.sauce-connect.json b/tests/visual/config/gemini.sauce-connect.json index 6ea0d3c7c..13b42a3e5 100644 --- a/tests/visual/config/gemini.sauce-connect.json +++ b/tests/visual/config/gemini.sauce-connect.json @@ -10,7 +10,7 @@ "screenResolution": "1280x1024", "recordVideo": "false" }, - "retry": 1 + "retry": 3 }, "firefox": { "desiredCapabilities": { @@ -20,7 +20,7 @@ "screenResolution": "1280x1024", "recordVideo": "false" }, - "retry": 1 + "retry": 3 }, "edge": { "desiredCapabilities": { @@ -29,7 +29,7 @@ "screenResolution": "1280x1024", "recordVideo": "false" }, - "retry": 1 + "retry": 3 }, "ie11": { "desiredCapabilities": { @@ -39,7 +39,7 @@ "screenResolution": "1280x1024", "recordVideo": "false" }, - "retry": 1 + "retry": 3 }, "ie10": { "desiredCapabilities": { @@ -49,7 +49,7 @@ "screenResolution": "1280x1024", "recordVideo": "false" }, - "retry": 1 + "retry": 3 } }, "system": {