RenderTest: GPU Render Tests Pass Silently
Add silently fail option to GPU based render tests. This is a pre-requisite to enable render tests on the buildbot. By default these render tests will pass silently. * Test will pass when using the `--pass-silently` arguments. * Only crashes will be reported as failed tests. * To find out failing test, review the test reports. `WITH_GPU_RENDER_TESTS_SILENT` compile option can be used to let tests pass (default) or fail (default for developers). Although some tests fail, they still passed. In the generated render report, the silently passed failures are correctly reported to be failures. Pull Request: https://projects.blender.org/blender/blender/pulls/117629
This commit is contained in:
@@ -147,10 +147,10 @@ class Report:
|
||||
def set_engine_name(self, engine_name):
|
||||
self.engine_name = engine_name
|
||||
|
||||
def run(self, dirpath, blender, arguments_cb, batch=False):
|
||||
def run(self, dirpath, blender, arguments_cb, batch=False, fail_silently=False):
|
||||
# Run tests and output report.
|
||||
dirname = os.path.basename(dirpath)
|
||||
ok = self._run_all_tests(dirname, dirpath, blender, arguments_cb, batch)
|
||||
ok = self._run_all_tests(dirname, dirpath, blender, arguments_cb, batch, fail_silently)
|
||||
self._write_data(dirname)
|
||||
self._write_html()
|
||||
if self.compare_engine:
|
||||
@@ -534,9 +534,10 @@ class Report:
|
||||
|
||||
return errors
|
||||
|
||||
def _run_all_tests(self, dirname, dirpath, blender, arguments_cb, batch):
|
||||
def _run_all_tests(self, dirname, dirpath, blender, arguments_cb, batch, fail_silently):
|
||||
passed_tests = []
|
||||
failed_tests = []
|
||||
silently_failed_tests = []
|
||||
all_files = list(blend_list(dirpath, self.device, self.blacklist))
|
||||
all_files.sort()
|
||||
print_message("Running {} tests from 1 test case." .
|
||||
@@ -551,7 +552,11 @@ class Report:
|
||||
return False
|
||||
elif error == "NO_START":
|
||||
return False
|
||||
failed_tests.append(testname)
|
||||
|
||||
if fail_silently and error != 'CRASH':
|
||||
silently_failed_tests.append(testname)
|
||||
else:
|
||||
failed_tests.append(testname)
|
||||
else:
|
||||
passed_tests.append(testname)
|
||||
self._write_test_html(dirname, filepath, error)
|
||||
@@ -564,12 +569,13 @@ class Report:
|
||||
print_message("{} tests." .
|
||||
format(len(passed_tests)),
|
||||
'SUCCESS', 'PASSED')
|
||||
if failed_tests:
|
||||
all_failed_tests = silently_failed_tests + failed_tests
|
||||
if all_failed_tests:
|
||||
print_message("{} tests, listed below:" .
|
||||
format(len(failed_tests)),
|
||||
format(len(all_failed_tests)),
|
||||
'FAILURE', 'FAILED')
|
||||
failed_tests.sort()
|
||||
for test in failed_tests:
|
||||
all_failed_tests.sort()
|
||||
for test in all_failed_tests:
|
||||
print_message("{}" . format(test), 'FAILURE', "FAILED")
|
||||
|
||||
return not bool(failed_tests)
|
||||
|
||||
Reference in New Issue
Block a user