|
32 | 32 | DB_JSON_ALL_CURRENT_FUNCS = 'all-project-current.json'
|
33 | 33 | DB_JSON_ALL_BRANCH_BLOCKERS = 'all-branch-blockers.json'
|
34 | 34 | DB_BUILD_STATUS_JSON = 'build-status.json'
|
| 35 | +DB_RAW_INTROSPECTOR_REPORTS = 'raw-introspector-reports' |
35 | 36 |
|
36 | 37 | ALL_JSON_FILES = [
|
37 | 38 | DB_JSON_DB_TIMESTAMP,
|
@@ -266,6 +267,16 @@ def rename_annotated_cfg(original_annotated_cfg):
|
266 | 267 | return new_annotated_cfg
|
267 | 268 |
|
268 | 269 |
|
| 270 | +def save_fuzz_introspector_report(introspector_report, project_name, date_str): |
| 271 | + if not os.path.isdir(DB_RAW_INTROSPECTOR_REPORTS): |
| 272 | + os.mkdir(DB_RAW_INTROSPECTOR_REPORTS) |
| 273 | + |
| 274 | + report_dst = os.path.join(DB_RAW_INTROSPECTOR_REPORTS, |
| 275 | + '%s-%s.json' % (project_name, date_str)) |
| 276 | + with open(report_dst, 'w') as report_fd: |
| 277 | + json.dump(introspector_report, report_fd) |
| 278 | + |
| 279 | + |
269 | 280 | def extract_project_data(project_name, date_str, should_include_details,
|
270 | 281 | manager_return_dict):
|
271 | 282 | """
|
@@ -307,6 +318,9 @@ def extract_project_data(project_name, date_str, should_include_details,
|
307 | 318 | introspector_report_url = get_introspector_report_url_report(
|
308 | 319 | project_name, date_str.replace("-", ""))
|
309 | 320 |
|
| 321 | + # Save the report |
| 322 | + save_fuzz_introspector_report(introspector_report, project_name, date_str) |
| 323 | + |
310 | 324 | # Currently, we fail if any of code_coverage_summary of introspector_report is
|
311 | 325 | # None. This should later be adjusted such that we can continue if we only
|
312 | 326 | # have code coverage but no introspector data. However, we need to adjust
|
@@ -691,6 +705,14 @@ def update_db_files(db_timestamp, project_timestamps, function_list,
|
691 | 705 | DB_JSON_ALL_PROJECT_TIMESTAMP,
|
692 | 706 | compress_type=zipfile.ZIP_DEFLATED)
|
693 | 707 |
|
| 708 | + # ZIP the archived introspector reports |
| 709 | + shutil.make_archive(DB_RAW_INTROSPECTOR_REPORTS, 'zip', |
| 710 | + DB_RAW_INTROSPECTOR_REPORTS) |
| 711 | + |
| 712 | + # Cleanup DB_RAW_INTROSPECTOR_REPORTS |
| 713 | + if os.path.isdir(DB_RAW_INTROSPECTOR_REPORTS): |
| 714 | + shutil.rmtree(DB_RAW_INTROSPECTOR_REPORTS) |
| 715 | + |
694 | 716 |
|
695 | 717 | def update_build_status(build_dict):
|
696 | 718 | with open(DB_BUILD_STATUS_JSON, "w") as f:
|
|
0 commit comments