mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Detect sauce error message in result.
This commit is contained in:
@@ -406,26 +406,29 @@ function onJobStart(error, res, body) {
|
|||||||
* @param {Object} body The response body JSON object.
|
* @param {Object} body The response body JSON object.
|
||||||
*/
|
*/
|
||||||
function onJobStatus(error, res, body) {
|
function onJobStatus(error, res, body) {
|
||||||
|
this.checking = false;
|
||||||
|
|
||||||
|
if (!this.running || this.stopping) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var completed = _.result(body, 'completed', false),
|
var completed = _.result(body, 'completed', false),
|
||||||
data = _.first(_.result(body, 'js tests')),
|
data = _.first(_.result(body, 'js tests')),
|
||||||
|
elapsed = (_.now() - this.timestamp) / 1000,
|
||||||
jobId = _.result(data, 'job_id', null),
|
jobId = _.result(data, 'job_id', null),
|
||||||
jobResult = _.result(data, 'result', null),
|
jobResult = _.result(data, 'result', null),
|
||||||
jobStatus = _.result(data, 'status', ''),
|
jobStatus = _.result(data, 'status', ''),
|
||||||
jobUrl = _.result(data, 'url', null),
|
jobUrl = _.result(data, 'url', null),
|
||||||
options = this.options,
|
|
||||||
message = _.result(jobResult, 'message'),
|
|
||||||
platform = options.platforms[0],
|
|
||||||
description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
|
|
||||||
elapsed = (_.now() - this.timestamp) / 1000,
|
|
||||||
errored = !_.isObject(jobResult) || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
|
|
||||||
expired = (elapsed >= queueTimeout && !_.contains(jobStatus, 'in progress')),
|
expired = (elapsed >= queueTimeout && !_.contains(jobStatus, 'in progress')),
|
||||||
failures = _.result(jobResult, 'failed'),
|
options = this.options,
|
||||||
label = options.name + ':',
|
platform = options.platforms[0];
|
||||||
tunnel = this.tunnel;
|
|
||||||
|
|
||||||
this.checking = false;
|
if (_.isObject(jobResult)) {
|
||||||
if (!this.running || this.stopping) {
|
var message = _.result(jobResult, 'message');
|
||||||
return;
|
} else {
|
||||||
|
if (typeof jobResult == 'string') {
|
||||||
|
message = jobResult;
|
||||||
|
}
|
||||||
|
jobResult = null;
|
||||||
}
|
}
|
||||||
if (isJobId(jobId)) {
|
if (isJobId(jobId)) {
|
||||||
this.id = jobId;
|
this.id = jobId;
|
||||||
@@ -440,6 +443,12 @@ function onJobStatus(error, res, body) {
|
|||||||
this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
|
this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
|
||||||
|
errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
|
||||||
|
failures = _.result(jobResult, 'failed'),
|
||||||
|
label = options.name + ':',
|
||||||
|
tunnel = this.tunnel;
|
||||||
|
|
||||||
if (errored || failures) {
|
if (errored || failures) {
|
||||||
if (errored && this.attempts < this.retries) {
|
if (errored && this.attempts < this.retries) {
|
||||||
this.restart();
|
this.restart();
|
||||||
|
|||||||
Reference in New Issue
Block a user