Skip to content

Commit 7aca19a

Browse files
authored
save binaries if we don't have coredumps (#625)
* save binaries if we don't have coredumps we still might have assert logs where they could be usefull for deciphering line numbers * only zip if we have indicators of a crash.
1 parent bd7582f commit 7aca19a

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

jenkins/helper/testing_runner.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -511,22 +511,23 @@ def generate_crash_report(self):
511511
core_files_list += system_corefiles
512512
if len(core_files_list) == 0 or core_max_count <= 0:
513513
print(f'Coredumps are not collected: {str(len(core_files_list))} coredumps found; coredumps max limit to collect is {str(core_max_count)}!')
514-
return
515-
if not self.crashed or self.success:
516-
self.append_report_txt("non captured crash reports found; please inspect the tests to find out who created them.")
517-
self.crashed = True
518-
self.success = False
519-
core_zip_dir = get_workspace() / 'coredumps'
520-
core_zip_dir.mkdir(parents=True, exist_ok=True)
521-
522-
crash_report_file = get_workspace() / datetime.now(tz=None).strftime(f"crashreport-{self.cfg.datetime_format}")
523-
self.mp_zip_tar(core_files_list, core_zip_dir, crash_report_file, 'coredump', 'crashreport')
524-
shutil.rmtree(str(core_zip_dir), ignore_errors=True)
525-
526-
self.cleanup_unneeded_binary_files()
527-
binary_report_file = get_workspace() / datetime.now(tz=None).strftime(f"binaries-{self.cfg.datetime_format}")
528-
bin_files_list = [f for f in self.cfg.bin_dir.glob('*') if not f.is_symlink()]
529-
self.mp_zip_tar(bin_files_list, self.cfg.bin_dir, binary_report_file, 'binary support', 'binreport')
514+
else:
515+
if not self.crashed or self.success:
516+
self.append_report_txt("non captured crash reports found; please inspect the tests to find out who created them.")
517+
self.crashed = True
518+
self.success = False
519+
core_zip_dir = get_workspace() / 'coredumps'
520+
core_zip_dir.mkdir(parents=True, exist_ok=True)
521+
522+
crash_report_file = get_workspace() / datetime.now(tz=None).strftime(f"crashreport-{self.cfg.datetime_format}")
523+
self.mp_zip_tar(core_files_list, core_zip_dir, crash_report_file, 'coredump', 'crashreport')
524+
shutil.rmtree(str(core_zip_dir), ignore_errors=True)
525+
526+
self.cleanup_unneeded_binary_files()
527+
if self.crashed:
528+
binary_report_file = get_workspace() / datetime.now(tz=None).strftime(f"binaries-{self.cfg.datetime_format}")
529+
bin_files_list = [f for f in self.cfg.bin_dir.glob('*') if not f.is_symlink()]
530+
self.mp_zip_tar(bin_files_list, self.cfg.bin_dir, binary_report_file, 'binary support', 'binreport')
530531

531532
def generate_test_report(self):
532533
""" regular testresults zip """

0 commit comments

Comments
 (0)