From 45318b4f19c59fc3870a98c81970d7b5d18ab05f Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 5 Sep 2019 12:32:25 -0700 Subject: Web: rely on new attributes when determining task failure Now that the job-output.json file has attributes for 'failed' or 'skipped' tasks, rely on those rather than hueristics for determining the result of a task. Change-Id: I2714c5a1776970d5339aafe2ca5e17abf5a3bb0b --- web/src/actions/build.js | 6 ------ web/src/actions/build.test.js | 4 ---- web/src/containers/build/Console.jsx | 6 +++--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/web/src/actions/build.js b/web/src/actions/build.js index c61aa8189..afb881377 100644 --- a/web/src/actions/build.js +++ b/web/src/actions/build.js @@ -87,12 +87,6 @@ export function didTaskFail(task) { if (task.failed) { return true } - if ('failed_when_result' in task && !task.failed_when_result) { - return false - } - if ('rc' in task && task.rc) { - return true - } if (task.results) { for (let result of task.results) { if (didTaskFail(result)) { diff --git a/web/src/actions/build.test.js b/web/src/actions/build.test.js index a80aa5d0b..436d96dcc 100644 --- a/web/src/actions/build.test.js +++ b/web/src/actions/build.test.js @@ -17,10 +17,6 @@ import * as buildAction from './build' it('processes job-output properly', () => { expect(buildAction.didTaskFail({failed: true})).toEqual(true) - expect(buildAction.didTaskFail({failed_when_result: true})).toEqual(false) - expect(buildAction.didTaskFail({failed_when_result: false})).toEqual(false) - expect(buildAction.didTaskFail({failed: false, rc: 1})).toEqual(true) - expect(buildAction.didTaskFail({results: [{rc: 1}]})).toEqual(true) expect(buildAction.hasInterestingKeys({rc: 42}, ['rc'])).toEqual(true) expect(buildAction.hasInterestingKeys({noop: 42}, ['rc'])).toEqual(false) diff --git a/web/src/containers/build/Console.jsx b/web/src/containers/build/Console.jsx index 97ac71947..01b308bfe 100644 --- a/web/src/containers/build/Console.jsx +++ b/web/src/containers/build/Console.jsx @@ -156,13 +156,13 @@ class HostTask extends React.Component { constructor (props) { super(props) - const { host, task, taskPath, displayPath, errorIds } = this.props + const { host, taskPath, displayPath } = this.props - if (errorIds.has(task.task.id)) { + if (host.failed) { this.state.failed = true } else if (host.changed) { this.state.changed = true - } else if (host.skip_reason) { + } else if (host.skipped) { this.state.skipped = true } else { this.state.ok = true -- cgit v1.2.1