Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: tools/foozzie/v8_foozzie.py

Issue 2635923002: [foozzie] Refactoring - move source hashing to main script (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/foozzie/v8_foozzie_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/foozzie/v8_foozzie.py
diff --git a/tools/foozzie/v8_foozzie.py b/tools/foozzie/v8_foozzie.py
index 86194b9871ee6b477972a8a7bdf20156b60a474a..19aca5c2900a7390c5a680596ea19177243b6794 100755
--- a/tools/foozzie/v8_foozzie.py
+++ b/tools/foozzie/v8_foozzie.py
@@ -8,6 +8,7 @@ V8 correctness fuzzer launcher script.
"""
import argparse
+import hashlib
import itertools
import json
import os
@@ -84,6 +85,13 @@ FAILURE_TEMPLATE = FAILURE_HEADER_TEMPLATE + """#
FUZZ_TEST_RE = re.compile(r'.*fuzz(-\d+\.js)')
SOURCE_RE = re.compile(r'print\("v8-foozzie source: (.*)"\);')
+# The number of hex digits used from the hash of the original source file path.
+# Keep the number small to avoid duplicate explosion.
+ORIGINAL_SOURCE_HASH_LENGTH = 3
+
+# Placeholder string if no original source file could be determined.
+ORIGINAL_SOURCE_DEFAULT = 'none'
+
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
@@ -235,8 +243,15 @@ def main():
if fail_bailout(second_config_output, suppress.ignore_by_output2):
return RETURN_FAIL
- difference, source, source_key = suppress.diff(
+ difference, source = suppress.diff(
first_config_output.stdout, second_config_output.stdout)
+
+ if source:
+ source_key = hashlib.sha1(source).hexdigest()[:ORIGINAL_SOURCE_HASH_LENGTH]
+ else:
+ source = ORIGINAL_SOURCE_DEFAULT
+ source_key = ORIGINAL_SOURCE_DEFAULT
+
if difference:
# The first three entries will be parsed by clusterfuzz. Format changes
# will require changes on the clusterfuzz side.
« no previous file with comments | « no previous file | tools/foozzie/v8_foozzie_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698