diff options
author | James E. Blair <jeblair@redhat.com> | 2019-09-05 12:32:25 -0700 |
---|---|---|
committer | Clark Boylan <clark.boylan@gmail.com> | 2019-09-06 12:06:37 -0700 |
commit | 45318b4f19c59fc3870a98c81970d7b5d18ab05f (patch) | |
tree | 8f583a7dabfc0aff17ee97cd097e0f1c7c916bdf | |
parent | cfe6a7b985125325605ef192b2de5fe1986ef569 (diff) | |
download | zuul-45318b4f19c59fc3870a98c81970d7b5d18ab05f.tar.gz |
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
-rw-r--r-- | web/src/actions/build.js | 6 | ||||
-rw-r--r-- | web/src/actions/build.test.js | 4 | ||||
-rw-r--r-- | 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 |