Browse Source

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
tags/3.10.2
James E. Blair 5 months ago
parent
commit
45318b4f19
3 changed files with 3 additions and 13 deletions
  1. +0
    -6
      web/src/actions/build.js
  2. +0
    -4
      web/src/actions/build.test.js
  3. +3
    -3
      web/src/containers/build/Console.jsx

+ 0
- 6
web/src/actions/build.js View File

@@ -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)) {

+ 0
- 4
web/src/actions/build.test.js View File

@@ -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)

+ 3
- 3
web/src/containers/build/Console.jsx View File

@@ -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

Loading…
Cancel
Save