Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (106034 => 106035)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2012-01-26 21:17:34 UTC (rev 106034)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2012-01-26 21:26:06 UTC (rev 106035)
@@ -102,6 +102,11 @@
return test_dict
+def use_trac_links_in_results_html(port_obj):
+ # We only use trac links on the buildbots.
+ # Use existence of builder_name as a proxy for knowing we're on a bot.
+ return port_obj.get_option("builder_name")
+
# FIXME: This should be on the Manager class (since that's the only caller)
# or split off from Manager onto another helper class, but should not be a free function.
# Most likely this should be made into its own class, and this super-long function
@@ -228,7 +233,10 @@
results['has_wdiff'] = port_obj.wdiff_available()
results['has_pretty_patch'] = port_obj.pretty_patch_available()
try:
- results['revision'] = port_obj.host.scm().head_svn_revision()
+ # We only use the svn revision for using trac links in the results.html file,
+ # Don't do this by default since it takes >100ms.
+ if use_trac_links_in_results_html(port_obj):
+ results['revision'] = port_obj.host.scm().head_svn_revision()
except Exception, e:
_log.warn("Failed to determine svn revision for checkout (cwd: %s, webkit_base: %s), leaving 'revision' key blank in full_results.json.\n%s" % (port_obj._filesystem.getcwd(), port_obj.path_from_webkit_base(), e))
# Handle cases where we're running outside of version control.
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py (106034 => 106035)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py 2012-01-26 21:17:34 UTC (rev 106034)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py 2012-01-26 21:26:06 UTC (rev 106035)
@@ -42,8 +42,12 @@
from webkitpy import layout_tests
from webkitpy.layout_tests import run_webkit_tests
+from webkitpy.layout_tests.controllers import manager
from webkitpy.layout_tests.controllers.manager import interpret_test_failures, Manager, natural_sort_key, test_key, TestRunInterruptedException, TestShard
+from webkitpy.layout_tests.models import result_summary
+from webkitpy.layout_tests.models import test_expectations
from webkitpy.layout_tests.models import test_failures
+from webkitpy.layout_tests.models import test_results
from webkitpy.layout_tests.models.result_summary import ResultSummary
from webkitpy.layout_tests.models.test_expectations import TestExpectations
from webkitpy.layout_tests.models.test_results import TestResult
@@ -370,6 +374,56 @@
self.assertTrue(test_dict['is_mismatch_reftest'])
self.assertEqual(test_dict['ref_file'], 'foo/common.html')
+ def get_result(self, test_name, result_type=test_expectations.PASS, run_time=0):
+ failures = []
+ if result_type == test_expectations.TIMEOUT:
+ failures = [test_failures.FailureTimeout()]
+ elif result_type == test_expectations.CRASH:
+ failures = [test_failures.FailureCrash()]
+ return test_results.TestResult(test_name, failures=failures, test_run_time=run_time)
+ def get_result_summary(self, port, test_names, expectations_str):
+ expectations = test_expectations.TestExpectations(port, test_names, expectations_str, port.test_configuration(), is_lint_mode=False)
+ return test_names, result_summary.ResultSummary(expectations, test_names), expectations
+
+ # FIXME: Use this to test more of summarize_results. This was moved from printing_unittest.py.
+ def get_unexpected_results(self, port, expected, passing, flaky):
+ tests = ['passes/text.html', 'failures/expected/timeout.html', 'failures/expected/crash.html']
+ expectations = ''
+ paths, rs, exp = self.get_result_summary(port, tests, expectations)
+ if expected:
+ rs.add(self.get_result('passes/text.html', test_expectations.PASS), expected)
+ rs.add(self.get_result('failures/expected/timeout.html', test_expectations.TIMEOUT), expected)
+ rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH), expected)
+ elif passing:
+ rs.add(self.get_result('passes/text.html'), expected)
+ rs.add(self.get_result('failures/expected/timeout.html'), expected)
+ rs.add(self.get_result('failures/expected/crash.html'), expected)
+ else:
+ rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT), expected)
+ rs.add(self.get_result('failures/expected/timeout.html', test_expectations.CRASH), expected)
+ rs.add(self.get_result('failures/expected/crash.html', test_expectations.TIMEOUT), expected)
+ retry = rs
+ if flaky:
+ paths, retry, exp = self.get_result_summary(port, tests, expectations)
+ retry.add(self.get_result('passes/text.html'), True)
+ retry.add(self.get_result('failures/expected/timeout.html'), True)
+ retry.add(self.get_result('failures/expected/crash.html'), True)
+ unexpected_results = manager.summarize_results(port, exp, rs, retry, test_timings={}, _only_unexpected_=True, interrupted=False)
+ return unexpected_results
+
+ def test_no_svn_revision(self):
+ host = MockHost()
+ port = host.port_factory.get('test')
+ results = self.get_unexpected_results(port, expected=False, passing=False, flaky=False)
+ self.assertTrue('revision' not in results)
+
+ def test_svn_revision(self):
+ host = MockHost()
+ port = host.port_factory.get('test')
+ port._options.builder_name = 'dummy builder'
+ results = self.get_unexpected_results(port, expected=False, passing=False, flaky=False)
+ self.assertTrue('revision' in results)
+
if __name__ == '__main__':
port_testcase.main()