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
This commit is contained in:
parent
cfe6a7b985
commit
45318b4f19
|
@ -87,12 +87,6 @@ export function didTaskFail(task) {
|
||||||
if (task.failed) {
|
if (task.failed) {
|
||||||
return true
|
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) {
|
if (task.results) {
|
||||||
for (let result of task.results) {
|
for (let result of task.results) {
|
||||||
if (didTaskFail(result)) {
|
if (didTaskFail(result)) {
|
||||||
|
|
|
@ -17,10 +17,6 @@ import * as buildAction from './build'
|
||||||
|
|
||||||
it('processes job-output properly', () => {
|
it('processes job-output properly', () => {
|
||||||
expect(buildAction.didTaskFail({failed: true})).toEqual(true)
|
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({rc: 42}, ['rc'])).toEqual(true)
|
||||||
expect(buildAction.hasInterestingKeys({noop: 42}, ['rc'])).toEqual(false)
|
expect(buildAction.hasInterestingKeys({noop: 42}, ['rc'])).toEqual(false)
|
||||||
|
|
|
@ -156,13 +156,13 @@ class HostTask extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(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
|
this.state.failed = true
|
||||||
} else if (host.changed) {
|
} else if (host.changed) {
|
||||||
this.state.changed = true
|
this.state.changed = true
|
||||||
} else if (host.skip_reason) {
|
} else if (host.skipped) {
|
||||||
this.state.skipped = true
|
this.state.skipped = true
|
||||||
} else {
|
} else {
|
||||||
this.state.ok = true
|
this.state.ok = true
|
||||||
|
|
Loading…
Reference in New Issue