Attach testcase to each crash.
(rows)
| 139 | |
| 140 | |
| 141 | def attach_testcases(rows): |
| 142 | """Attach testcase to each crash.""" |
| 143 | testcases = {} |
| 144 | for index, row in enumerate(rows): |
| 145 | testcases[index] = { |
| 146 | 'open_testcase': |
| 147 | query_testcase( |
| 148 | project_name=row['projectName'], |
| 149 | crash_type=row['crashType'], |
| 150 | crash_state=row['crashState'], |
| 151 | security_flag=row['isSecurity'], |
| 152 | is_open=True), |
| 153 | 'closed_testcase': |
| 154 | query_testcase( |
| 155 | project_name=row['projectName'], |
| 156 | crash_type=row['crashType'], |
| 157 | crash_state=row['crashState'], |
| 158 | security_flag=row['isSecurity'], |
| 159 | is_open=False) |
| 160 | } |
| 161 | |
| 162 | for index, row in enumerate(rows): |
| 163 | testcase = (list(testcases[index]['open_testcase']) or |
| 164 | list(testcases[index]['closed_testcase']) or [None])[0] |
| 165 | if testcase: |
| 166 | testcase = { |
| 167 | 'id': testcase.key.id(), |
| 168 | 'issueNumber': testcase.bug_information, |
| 169 | 'groupIssueNumber': testcase.group_bug_information |
| 170 | } |
| 171 | row['testcase'] = testcase |
| 172 | |
| 173 | |
| 174 | def get_result(): |
no test coverage detected