summaryrefslogtreecommitdiffstats
path: root/media/tools
diff options
context:
space:
mode:
authorimasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 13:47:24 +0000
committerimasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 13:47:24 +0000
commit796a2ea496c28dd1ed60d480b1e43802705ef902 (patch)
treea436e7d8810bc2e5218660a09084d03a29253537 /media/tools
parenta567a9ff867e1a12f01e2a7e45158767597378b2 (diff)
downloadchromium_src-796a2ea496c28dd1ed60d480b1e43802705ef902.zip
chromium_src-796a2ea496c28dd1ed60d480b1e43802705ef902.tar.gz
chromium_src-796a2ea496c28dd1ed60d480b1e43802705ef902.tar.bz2
Add a command-line option about status email in the layout test analyzer.
When this option is on, the analyzer sends out email only when there is the change in the result comparing to the last result. Review URL: http://codereview.chromium.org/7850023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools')
-rw-r--r--media/tools/layout_tests/layouttest_analyzer.py10
-rw-r--r--media/tools/layout_tests/layouttest_analyzer_helpers.py11
2 files changed, 19 insertions, 2 deletions
diff --git a/media/tools/layout_tests/layouttest_analyzer.py b/media/tools/layout_tests/layouttest_analyzer.py
index 3033a1d..717d452 100644
--- a/media/tools/layout_tests/layouttest_analyzer.py
+++ b/media/tools/layout_tests/layouttest_analyzer.py
@@ -84,6 +84,13 @@ def parse_option():
'(default to %default and no text is '
'appended in that case.)'),
default=None)
+ option_parser.add_option('-c', '--email-only-change-mode',
+ dest='email_only_change_mode',
+ help=('With this mode, email is sent out '
+ 'only when there is a change in the '
+ 'analyzer result compared to the previous '
+ 'result (off by default)'),
+ action='store_true', default=False)
return option_parser.parse_args()[0]
@@ -139,7 +146,8 @@ def main():
anno_map,
options.receiver_email_address,
options.test_group_name,
- appended_text_to_email)
+ appended_text_to_email,
+ options.email_only_change_mode)
if not options.debug:
# Save the current result.
date = start_time.strftime('%Y-%m-%d-%H')
diff --git a/media/tools/layout_tests/layouttest_analyzer_helpers.py b/media/tools/layout_tests/layouttest_analyzer_helpers.py
index fda23c6..15a3f96 100644
--- a/media/tools/layout_tests/layouttest_analyzer_helpers.py
+++ b/media/tools/layout_tests/layouttest_analyzer_helpers.py
@@ -264,7 +264,7 @@ class AnalyzerResultMap:
def SendStatusEmail(prev_time, analyzer_result_map, prev_analyzer_result_map,
bug_anno_map, receiver_email_address, test_group_name,
- appended_text_to_email):
+ appended_text_to_email, email_only_change_mode):
"""Send status email.
Args:
@@ -279,9 +279,18 @@ def SendStatusEmail(prev_time, analyzer_result_map, prev_analyzer_result_map,
test_group_name: string representing the test group name (e.g., 'media').
appended_text_to_email: a text which is appended at the end of the status
email.
+ email_only_change_mode: when this is true, the analyzer sends out the
+ status email only when there is change in the analyzer result compared
+ to the last result. When this is false, it sends the email out every
+ time it runs.
"""
diff_map = analyzer_result_map.CompareToOtherResultMap(
prev_analyzer_result_map)
+ # Do not email when |email_only_change_mode| is true and there is no change
+ # in the result compared to the last result.
+ if (email_only_change_mode and not any(diff_map['whole']) and
+ not any(diff_map['skip']) and not any(diff_map['nonskip'])):
+ return
output_str = analyzer_result_map.ConvertToString(prev_time,
diff_map, bug_anno_map)
# Add diff info about skipped/non-skipped test.