Title: [120864] trunk/Tools
- Revision
- 120864
- Author
- [email protected]
- Date
- 2012-06-20 14:25:08 -0700 (Wed, 20 Jun 2012)
Log Message
nrwt: fix unit tests for ensuring svn revision is correct
https://bugs.webkit.org/show_bug.cgi?id=89498
Reviewed by Eric Seidel.
Reviewed by Eric Seidel.
Fix the unit tests for testing that we are embedding the SVN
revision in the results json for NRWT properly; this was broken
in r120646 but because the MockHost worked differently than the
real one (by always initializing the MockSCM object) we didn't
notice. Unfortunately, just changing the default breaks all
sorts of unit tests ...
* Scripts/webkitpy/common/host_mock.py:
(MockHost.__init__):
(MockHost._initialize_scm):
* Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
(ResultSummaryTest.test_no_svn_revision):
(ResultSummaryTest.test_svn_revision):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (120863 => 120864)
--- trunk/Tools/ChangeLog 2012-06-20 21:22:35 UTC (rev 120863)
+++ trunk/Tools/ChangeLog 2012-06-20 21:25:08 UTC (rev 120864)
@@ -1,5 +1,28 @@
2012-06-20 Dirk Pranke <[email protected]>
+ nrwt: fix unit tests for ensuring svn revision is correct
+ https://bugs.webkit.org/show_bug.cgi?id=89498
+
+ Reviewed by Eric Seidel.
+
+ Reviewed by Eric Seidel.
+
+ Fix the unit tests for testing that we are embedding the SVN
+ revision in the results json for NRWT properly; this was broken
+ in r120646 but because the MockHost worked differently than the
+ real one (by always initializing the MockSCM object) we didn't
+ notice. Unfortunately, just changing the default breaks all
+ sorts of unit tests ...
+
+ * Scripts/webkitpy/common/host_mock.py:
+ (MockHost.__init__):
+ (MockHost._initialize_scm):
+ * Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
+ (ResultSummaryTest.test_no_svn_revision):
+ (ResultSummaryTest.test_svn_revision):
+
+2012-06-20 Dirk Pranke <[email protected]>
+
new-run-webkit-tests appends "/Debug" or "/Release" to $WEBKITOUTPUTDIR
https://bugs.webkit.org/show_bug.cgi?id=69360
Modified: trunk/Tools/Scripts/webkitpy/common/host_mock.py (120863 => 120864)
--- trunk/Tools/Scripts/webkitpy/common/host_mock.py 2012-06-20 21:22:35 UTC (rev 120863)
+++ trunk/Tools/Scripts/webkitpy/common/host_mock.py 2012-06-20 21:25:08 UTC (rev 120864)
@@ -40,17 +40,17 @@
class MockHost(MockSystemHost):
- def __init__(self, log_executive=False, executive_throws_when_run=None):
+ def __init__(self, log_executive=False, executive_throws_when_run=None, initialize_scm_by_default=True):
MockSystemHost.__init__(self, log_executive, executive_throws_when_run)
add_unit_tests_to_mock_filesystem(self.filesystem)
self.web = MockWeb()
self._checkout = MockCheckout()
- self._scm = MockSCM(filesystem=self.filesystem, executive=self.executive)
- # Various pieces of code (wrongly) call filesystem.chdir(checkout_root).
- # Making the checkout_root exist in the mock filesystem makes that chdir not raise.
- self.filesystem.maybe_make_directory(self._scm.checkout_root)
-
+ self._scm = None
+ # FIXME: we should never initialize the SCM by default, since the real
+ # object doesn't either. This has caused at least one bug (see bug 89498).
+ if initialize_scm_by_default:
+ self._initialize_scm()
self.bugs = MockBugzilla()
self.buildbot = MockBuildBot()
self._chromium_buildbot = MockBuildBot()
@@ -62,7 +62,10 @@
self._watch_list = MockWatchList()
def _initialize_scm(self, patch_directories=None):
- pass
+ self._scm = MockSCM(filesystem=self.filesystem, executive=self.executive)
+ # Various pieces of code (wrongly) call filesystem.chdir(checkout_root).
+ # Making the checkout_root exist in the mock filesystem makes that chdir not raise.
+ self.filesystem.maybe_make_directory(self._scm.checkout_root)
def scm(self):
return self._scm
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py (120863 => 120864)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py 2012-06-20 21:22:35 UTC (rev 120863)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py 2012-06-20 21:25:08 UTC (rev 120864)
@@ -516,17 +516,17 @@
return expected_results, unexpected_results
def test_no_svn_revision(self):
- host = MockHost()
+ host = MockHost(initialize_scm_by_default=False)
port = host.port_factory.get('test')
expected_results, unexpected_results = self.summarized_results(port, expected=False, passing=False, flaky=False)
self.assertTrue('revision' not in unexpected_results)
def test_svn_revision(self):
- host = MockHost()
+ host = MockHost(initialize_scm_by_default=False)
port = host.port_factory.get('test')
port._options.builder_name = 'dummy builder'
expected_results, unexpected_results = self.summarized_results(port, expected=False, passing=False, flaky=False)
- self.assertTrue('revision' in unexpected_results)
+ self.assertNotEquals(unexpected_results['revision'], '')
def test_summarized_results_wontfix(self):
host = MockHost()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes