e2e: conft
This commit is contained in:
parent
d6b746937b
commit
059ff3c0f3
|
@ -216,16 +216,16 @@ def should_save_device_stats(config):
|
||||||
def pytest_runtest_makereport(item, call):
|
def pytest_runtest_makereport(item, call):
|
||||||
outcome = yield
|
outcome = yield
|
||||||
report = outcome.get_result()
|
report = outcome.get_result()
|
||||||
# if "xdist_group" in item.keywords._markers and report.when == "setup" and report.failed:
|
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.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.create_new_testrun()
|
||||||
# test_suite_data.current_test.group_name = item.instance.__class__.__name__
|
test_suite_data.current_test.group_name = item.instance.__class__.__name__
|
||||||
# error = report.longreprtext
|
error = report.longreprtext
|
||||||
# exception = re.findall('E.*Message:|E.*Error:|E.*Failed:', error)
|
exception = re.findall('E.*Message:|E.*Error:|E.*Failed:', error)
|
||||||
# if exception:
|
if exception:
|
||||||
# error = error.replace(re.findall('E.*Message:|E.*Error:|E.*Failed:', report.longreprtext)[0], '')
|
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
|
test_suite_data.current_test.testruns[-1].error = "Test setup failed: \n" + error
|
||||||
# github_report.save_test(test_suite_data.current_test)
|
github_report.save_test(test_suite_data.current_test)
|
||||||
if report.when == 'call':
|
if report.when == 'call':
|
||||||
is_sauce_env = item.config.getoption('env') == 'sauce'
|
is_sauce_env = item.config.getoption('env') == 'sauce'
|
||||||
current_test = test_suite_data.current_test
|
current_test = test_suite_data.current_test
|
||||||
|
@ -292,9 +292,9 @@ def pytest_runtest_protocol(item, nextitem):
|
||||||
for i in range(rerun_count):
|
for i in range(rerun_count):
|
||||||
reports = runtestprotocol(item, nextitem=nextitem)
|
reports = runtestprotocol(item, nextitem=nextitem)
|
||||||
for report in reports:
|
for report in reports:
|
||||||
is_in_group = [i for i in item.iter_markers(name='xdist_group')]
|
# 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) and not is_in_group:
|
||||||
# if report.failed and should_rerun_test(report.longreprtext):
|
if report.failed and should_rerun_test(report.longreprtext):
|
||||||
break # rerun
|
break # rerun
|
||||||
else:
|
else:
|
||||||
return True # no need to rerun
|
return True # no need to rerun
|
||||||
|
|
Loading…
Reference in New Issue