MCPcopy
hub / github.com/google/clusterfuzz / attach_testcases

Function attach_testcases

src/appengine/handlers/crash_stats.py:141–171  ·  view source on GitHub ↗

Attach testcase to each crash.

(rows)

Source from the content-addressed store, hash-verified

139
140
141def 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
174def get_result():

Callers 1

get_resultFunction · 0.70

Calls 2

query_testcaseFunction · 0.70
idMethod · 0.45

Tested by

no test coverage detected