testhide-pytest-plugin 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {testhide_pytest_plugin-0.2.1/src/testhide_pytest_plugin.egg-info → testhide_pytest_plugin-0.2.2}/PKG-INFO +1 -1
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/pyproject.toml +1 -1
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_plugin/plugin.py +60 -26
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2/src/testhide_pytest_plugin.egg-info}/PKG-INFO +1 -1
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/LICENSE +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/README.md +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/setup.cfg +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_plugin/__init__.py +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_plugin/hookspecs.py +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_pytest_plugin.egg-info/SOURCES.txt +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_pytest_plugin.egg-info/dependency_links.txt +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_pytest_plugin.egg-info/entry_points.txt +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_pytest_plugin.egg-info/requires.txt +0 -0
- {testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_pytest_plugin.egg-info/top_level.txt +0 -0
|
@@ -152,7 +152,7 @@ class TesthidePlugin:
|
|
|
152
152
|
if summary not in "".join(final_trace_lines):
|
|
153
153
|
final_trace_lines.append(summary)
|
|
154
154
|
|
|
155
|
-
return "
|
|
155
|
+
return "".join(final_trace_lines)
|
|
156
156
|
else:
|
|
157
157
|
return summary
|
|
158
158
|
|
|
@@ -167,6 +167,21 @@ class TesthidePlugin:
|
|
|
167
167
|
|
|
168
168
|
if report.when in ('setup', 'call') and getattr(report, 'outcome', '') != 'rerun':
|
|
169
169
|
item._final_report = report
|
|
170
|
+
|
|
171
|
+
if call.when == 'call' and call.excinfo:
|
|
172
|
+
fail_message = str(call.excinfo.value)
|
|
173
|
+
try:
|
|
174
|
+
fail_id = '%s.%s.%s.%s' % \
|
|
175
|
+
(item.module.__name__,
|
|
176
|
+
item.cls.__name__ if item.cls
|
|
177
|
+
else item.module.__name__,
|
|
178
|
+
re.sub(r'\[.+\]$', '', item.name),
|
|
179
|
+
'%s(%s)' % (call.excinfo.typename, fail_message))
|
|
180
|
+
except AttributeError:
|
|
181
|
+
return
|
|
182
|
+
fail_id = fail_id.encode('utf-8')
|
|
183
|
+
fail_id = md5(fail_id).hexdigest()
|
|
184
|
+
item.fail_id = fail_id
|
|
170
185
|
|
|
171
186
|
@pytest.hookimpl(trylast=True)
|
|
172
187
|
def pytest_runtest_teardown(self, item):
|
|
@@ -178,19 +193,17 @@ class TesthidePlugin:
|
|
|
178
193
|
if not report:
|
|
179
194
|
return
|
|
180
195
|
|
|
181
|
-
filepath, line,
|
|
196
|
+
filepath, line, _ = report.location
|
|
197
|
+
name = item.originalname if hasattr(item, 'originalname') else item.name
|
|
198
|
+
name = name.split('[')[0]
|
|
182
199
|
classname_path = report.nodeid.split('::')
|
|
183
200
|
if len(classname_path) > 2:
|
|
184
201
|
classname = ".".join(classname_path[:-1]).replace('/', '.')
|
|
185
202
|
else:
|
|
186
203
|
classname = os.path.splitext(os.path.basename(filepath))[0]
|
|
187
204
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
'line': str(line), 'time': f"{report.duration:.3f}"
|
|
191
|
-
}
|
|
192
|
-
testcase = ET.Element('testcase', **testcase_attrs)
|
|
193
|
-
|
|
205
|
+
fail_id = getattr(item, 'fail_id', None)
|
|
206
|
+
test_resolution = 'Product Defect'
|
|
194
207
|
if report.failed:
|
|
195
208
|
tag = 'error' if report.when == 'setup' else 'failure'
|
|
196
209
|
failure_message = str(report.longrepr.reprcrash.message) if hasattr(report.longrepr, 'reprcrash') else str(
|
|
@@ -198,34 +211,55 @@ class TesthidePlugin:
|
|
|
198
211
|
|
|
199
212
|
if self.jira_enabled:
|
|
200
213
|
try:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
if fail_id:
|
|
215
|
+
issue = self._get_issue_by_test_id(fail_id)
|
|
216
|
+
if issue:
|
|
217
|
+
issue_text = issue.fields.summary
|
|
218
|
+
issue_type = issue.fields.issuetype.name
|
|
219
|
+
issue_id = issue.permalink()
|
|
220
|
+
status_name = issue.fields.status.name
|
|
221
|
+
if status_name in ('Verified', 'Closed'):
|
|
222
|
+
if hasattr(issue.fields, 'customfield_10020') and issue.fields.customfield_10020:
|
|
223
|
+
status = issue.fields.customfield_10020.value
|
|
224
|
+
if status_name == 'Verified' and status == 'Verified at Branch':
|
|
225
|
+
test_resolution = 'Verified at Branch'
|
|
226
|
+
else:
|
|
227
|
+
test_resolution = 'Need to reopen'
|
|
228
|
+
else:
|
|
229
|
+
test_resolution = 'Need to reopen'
|
|
230
|
+
elif status_name in ['Resolved', 'In Testing']:
|
|
231
|
+
test_resolution = 'Resolved in branch'
|
|
232
|
+
else:
|
|
233
|
+
test_resolution = 'Known issue'
|
|
234
|
+
failure_message = f'{test_resolution} {issue_id} {issue_type} [{issue_text}]'
|
|
219
235
|
except Exception as e:
|
|
220
236
|
self.config.warn('JIRA_MARKER_ERROR', f"JIRA marker failed: {e}")
|
|
221
237
|
|
|
238
|
+
testcase_attrs = {
|
|
239
|
+
'classname': classname, 'name': name, 'file': str(filepath),
|
|
240
|
+
'line': str(line), 'time': f"{report.duration:.3f}", "fail_id": fail_id, "test_resolution": test_resolution,
|
|
241
|
+
}
|
|
242
|
+
testcase = ET.Element('testcase', **testcase_attrs)
|
|
222
243
|
failure_element = ET.SubElement(testcase, tag, message=failure_message)
|
|
223
244
|
failure_element.text = self._get_cleaned_traceback(report)
|
|
224
245
|
|
|
225
246
|
elif report.skipped:
|
|
247
|
+
testcase_attrs = {
|
|
248
|
+
'classname': classname, 'name': name, 'file': str(filepath),
|
|
249
|
+
'line': str(line), 'time': f"{report.duration:.3f}", "fail_id": '',
|
|
250
|
+
"test_resolution": "Skipped",
|
|
251
|
+
}
|
|
252
|
+
testcase = ET.Element('testcase', **testcase_attrs)
|
|
226
253
|
skipped_attrs = {'type': 'pytest.skip', 'message': report.longrepr[2]}
|
|
227
254
|
ET.SubElement(testcase, 'skipped',
|
|
228
255
|
**skipped_attrs).text = f"{report.longrepr[0]}:{report.longrepr[1]}: {report.longrepr[2]}"
|
|
256
|
+
else:
|
|
257
|
+
testcase_attrs = {
|
|
258
|
+
'classname': classname, 'name': name, 'file': str(filepath),
|
|
259
|
+
'line': str(line), 'time': f"{report.duration:.3f}", "fail_id": '',
|
|
260
|
+
"test_resolution": "Passed",
|
|
261
|
+
}
|
|
262
|
+
testcase = ET.Element('testcase', **testcase_attrs)
|
|
229
263
|
|
|
230
264
|
all_properties = self.config.hook.pytest_testhide_get_test_case_properties(item=item, report=report)
|
|
231
265
|
flat_properties = [prop for sublist in all_properties for prop in sublist]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_plugin/__init__.py
RENAMED
|
File without changes
|
{testhide_pytest_plugin-0.2.1 → testhide_pytest_plugin-0.2.2}/src/testhide_plugin/hookspecs.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|