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 1 week 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) {
87 87
   if (task.failed) {
88 88
     return true
89 89
   }
90
-  if ('failed_when_result' in task && !task.failed_when_result) {
91
-    return false
92
-  }
93
-  if ('rc' in task && task.rc) {
94
-    return true
95
-  }
96 90
   if (task.results) {
97 91
     for (let result of task.results) {
98 92
       if (didTaskFail(result)) {

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

@@ -17,10 +17,6 @@ import * as buildAction from './build'
17 17
 
18 18
 it('processes job-output properly', () => {
19 19
   expect(buildAction.didTaskFail({failed: true})).toEqual(true)
20
-  expect(buildAction.didTaskFail({failed_when_result: true})).toEqual(false)
21
-  expect(buildAction.didTaskFail({failed_when_result: false})).toEqual(false)
22
-  expect(buildAction.didTaskFail({failed: false, rc: 1})).toEqual(true)
23
-  expect(buildAction.didTaskFail({results: [{rc: 1}]})).toEqual(true)
24 20
 
25 21
   expect(buildAction.hasInterestingKeys({rc: 42}, ['rc'])).toEqual(true)
26 22
   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 {
156 156
   constructor (props) {
157 157
     super(props)
158 158
 
159
-    const { host, task, taskPath, displayPath, errorIds } = this.props
159
+    const { host, taskPath, displayPath } = this.props
160 160
 
161
-    if (errorIds.has(task.task.id)) {
161
+    if (host.failed) {
162 162
       this.state.failed = true
163 163
     } else if (host.changed) {
164 164
       this.state.changed = true
165
-    } else if (host.skip_reason) {
165
+    } else if (host.skipped) {
166 166
       this.state.skipped = true
167 167
     } else {
168 168
       this.state.ok = true

Loading…
Cancel
Save