| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from model import analysis_status | 5 from model import analysis_status |
| 6 | 6 |
| 7 # Additional status for swarming tasks and try jobs. | 7 # Additional status for swarming tasks and try jobs. |
| 8 NO_SWARMING_TASK_FOUND = 110 | 8 NO_SWARMING_TASK_FOUND = 110 |
| 9 NON_SWARMING_NO_RERUN = 120 | 9 NON_SWARMING_NO_RERUN = 120 |
| 10 #Additional reasons for no try job information. | 10 # Additional reasons for no try job information. |
| 11 SWARMING_TASK_PENDING = 130 | 11 SWARMING_TASK_PENDING = 130 |
| 12 SWARMING_TASK_RUNNING = 140 | 12 SWARMING_TASK_RUNNING = 140 |
| 13 SWARMING_TASK_ERROR = 150 | 13 SWARMING_TASK_ERROR = 150 |
| 14 NO_FAILURE_RESULT_MAP = 160 | 14 NO_FAILURE_RESULT_MAP = 160 |
| 15 FLAKY = 200 | 15 FLAKY = 200 |
| 16 # Universal status for unknowns. |
| 17 UNKNOWN = 210 |
| 16 | 18 |
| 17 NO_TRY_JOB_REASON_MAP = { | 19 NO_TRY_JOB_REASON_MAP = { |
| 18 NO_SWARMING_TASK_FOUND: NO_SWARMING_TASK_FOUND, | 20 NO_SWARMING_TASK_FOUND: NO_SWARMING_TASK_FOUND, |
| 19 NON_SWARMING_NO_RERUN: NON_SWARMING_NO_RERUN, | 21 NON_SWARMING_NO_RERUN: NON_SWARMING_NO_RERUN, |
| 20 NO_FAILURE_RESULT_MAP: NO_FAILURE_RESULT_MAP, | 22 NO_FAILURE_RESULT_MAP: NO_FAILURE_RESULT_MAP, |
| 21 analysis_status.PENDING: SWARMING_TASK_PENDING, | 23 analysis_status.PENDING: SWARMING_TASK_PENDING, |
| 22 analysis_status.RUNNING: SWARMING_TASK_RUNNING, | 24 analysis_status.RUNNING: SWARMING_TASK_RUNNING, |
| 23 analysis_status.ERROR: SWARMING_TASK_ERROR, | 25 analysis_status.ERROR: SWARMING_TASK_ERROR, |
| 24 } | 26 } |
| 25 | 27 |
| 26 STATUS_MESSAGE_MAP = { | 28 STATUS_MESSAGE_MAP = { |
| 27 analysis_status.PENDING: 'Try job is pending.', | 29 analysis_status.PENDING: 'Try job is pending.', |
| 28 analysis_status.RUNNING: 'Try job is running.', | 30 analysis_status.RUNNING: 'Try job is running.', |
| 29 analysis_status.COMPLETED: 'Not Found.', | 31 analysis_status.COMPLETED: 'Not Found.', |
| 30 analysis_status.ERROR: 'Try job failed.', | 32 analysis_status.ERROR: 'Try job failed.', |
| 31 NO_SWARMING_TASK_FOUND: 'No swarming task found, hence no try job.', | 33 NO_SWARMING_TASK_FOUND: 'No swarming task found, hence no try job.', |
| 32 NON_SWARMING_NO_RERUN: ('No swarming task nor try job will be triggered' | 34 NON_SWARMING_NO_RERUN: ('No swarming task nor try job will be triggered' |
| 33 ' for non-swarming steps.'), | 35 ' for non-swarming steps.'), |
| 34 SWARMING_TASK_PENDING: 'Swarming task is pending, no try job yet.', | 36 SWARMING_TASK_PENDING: 'Swarming task is pending, no try job yet.', |
| 35 SWARMING_TASK_RUNNING: 'Swarming task is running, no try job yet.', | 37 SWARMING_TASK_RUNNING: 'Swarming task is running, no try job yet.', |
| 36 SWARMING_TASK_ERROR: ( | 38 SWARMING_TASK_ERROR: ( |
| 37 'Swarming task failed, try job will not be triggered.'), | 39 'Swarming task failed, try job will not be triggered.'), |
| 38 NO_FAILURE_RESULT_MAP: 'No swarming task nor try job was triggered.', | 40 NO_FAILURE_RESULT_MAP: 'No swarming task nor try job was triggered.', |
| 39 FLAKY: 'Flaky tests.', | 41 FLAKY: 'Flaky tests.', |
| 42 UNKNOWN: 'Unknown failure.' |
| 40 } | 43 } |
| OLD | NEW |