[autotest] Delete dir_summary json files in parsing
The directory summary files have no debugging value and not human readable.
BUG=None
TEST=unittest, local test.
Change-Id: I05e0032a7d45dbfcba2a5a779b119afba24d59c2
Reviewed-on: https://chromium-review.googlesource.com/675665
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/server/site_utils.py b/server/site_utils.py
index d57a690..d408248 100644
--- a/server/site_utils.py
+++ b/server/site_utils.py
@@ -970,11 +970,16 @@
sizes.
"""
try:
- client_collected_bytes, summary = result_utils.merge_summaries(path)
+ client_collected_bytes, summary, files = result_utils.merge_summaries(
+ path)
result_size_info = result_utils_lib.get_result_size_info(
client_collected_bytes, summary)
html_file = os.path.join(path, result_view.DEFAULT_RESULT_SUMMARY_NAME)
result_view.build(client_collected_bytes, summary, html_file)
+
+ # Delete all summary files after final view is built.
+ for summary_file in files:
+ os.remove(summary_file)
except:
log('Failed to calculate result sizes based on directory summaries for '
'directory %s. Fall back to record the total size.\nException: %s' %