e2e: conft

This commit is contained in:
Churikova Tetiana 2022-04-30 07:53:21 +02:00
parent d6b746937b
commit 059ff3c0f3
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
1 changed files with 13 additions and 13 deletions

View File

@ -216,16 +216,16 @@ def should_save_device_stats(config):
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
# if "xdist_group" in item.keywords._markers and report.when == "setup" and report.failed:
# test_suite_data.set_current_test(item.name, testrail_case_id=get_testrail_case_id(item))
# test_suite_data.current_test.create_new_testrun()
# test_suite_data.current_test.group_name = item.instance.__class__.__name__
# error = report.longreprtext
# exception = re.findall('E.*Message:|E.*Error:|E.*Failed:', error)
# if exception:
# error = error.replace(re.findall('E.*Message:|E.*Error:|E.*Failed:', report.longreprtext)[0], '')
# test_suite_data.current_test.testruns[-1].error = "Test setup failed: \n" + error
# github_report.save_test(test_suite_data.current_test)
if "xdist_group" in item.keywords._markers and report.when == "setup" and report.failed:
test_suite_data.set_current_test(item.name, testrail_case_id=get_testrail_case_id(item))
test_suite_data.current_test.create_new_testrun()
test_suite_data.current_test.group_name = item.instance.__class__.__name__
error = report.longreprtext
exception = re.findall('E.*Message:|E.*Error:|E.*Failed:', error)
if exception:
error = error.replace(re.findall('E.*Message:|E.*Error:|E.*Failed:', report.longreprtext)[0], '')
test_suite_data.current_test.testruns[-1].error = "Test setup failed: \n" + error
github_report.save_test(test_suite_data.current_test)
if report.when == 'call':
is_sauce_env = item.config.getoption('env') == 'sauce'
current_test = test_suite_data.current_test
@ -292,9 +292,9 @@ def pytest_runtest_protocol(item, nextitem):
for i in range(rerun_count):
reports = runtestprotocol(item, nextitem=nextitem)
for report in reports:
is_in_group = [i for i in item.iter_markers(name='xdist_group')]
if report.failed and should_rerun_test(report.longreprtext) and not is_in_group:
# if report.failed and should_rerun_test(report.longreprtext):
# is_in_group = [i for i in item.iter_markers(name='xdist_group')]
# if report.failed and should_rerun_test(report.longreprtext) and not is_in_group:
if report.failed and should_rerun_test(report.longreprtext):
break # rerun
else:
return True # no need to rerun