Bug 1417051 - Don't report test start/end twice. draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 30 Nov 2017 16:08:10 +0100
changeset 706933 e0740c78f1264a3f35ee83671831abba0105e617
parent 706692 709f355a7a8c4ae426d1824841a71ffdb5ce0137
child 706934 1b0d90dd1f1c39becaed744b081c4159ea764695
child 707450 26afade6d137205e94d19a66cb9428b79f6f5fe1
push id91960
push userbmo:hskupin@gmail.com
push dateMon, 04 Dec 2017 13:53:14 +0000
bugs1417051
milestone59.0a1
Bug 1417051 - Don't report test start/end twice. The harness already logs the start and end of the test via mozlog. So there is no need to do it twice. Especially because this requires another command send to Marionette server. MozReview-Commit-ID: 5JfU9XgbVqx
testing/marionette/harness/marionette_harness/marionette_test/testcases.py
--- a/testing/marionette/harness/marionette_harness/marionette_test/testcases.py
+++ b/testing/marionette/harness/marionette_harness/marionette_test/testcases.py
@@ -13,17 +13,16 @@ import weakref
 
 from unittest.case import (
     _ExpectedFailure,
     _UnexpectedSuccess,
     SkipTest,
 )
 
 from marionette_driver.errors import (
-    MarionetteException,
     TimeoutException,
 )
 from mozlog import get_default_logger
 
 
 def _wraps_parameterized(func, func_suffix, args, kwargs):
     """Internal: Decorator used in class MetaParameterized."""
     def wrapper(self):
@@ -306,36 +305,24 @@ class MarionetteTestCase(CommonTestCase)
                                       methodName=testname,
                                       filepath=filepath,
                                       testvars=testvars,
                                       **kwargs))
 
     def setUp(self):
         super(MarionetteTestCase, self).setUp()
         self.marionette.test_name = self.test_name
-        self.marionette.execute_script(r"dump('TEST-START: {0}\n')"
-                                       .format(self.test_name),
-                                       sandbox="simpletest")
 
     def tearDown(self):
         # In the case no session is active (eg. the application was quit), start
         # a new session for clean-up steps.
         if not self.marionette.session:
             self.marionette.start_session()
 
-        if not self.marionette.crashed:
-            try:
-                self.marionette.execute_script(r"dump('TEST-END: {0}\n')"
-                                               .format(self.test_name),
-                                               sandbox="simpletest")
-                self.marionette.test_name = None
-            except (MarionetteException, IOError):
-                # We have tried to log the test end when there is no listener
-                # object that we can access
-                pass
+        self.marionette.test_name = None
 
         super(MarionetteTestCase, self).tearDown()
 
     def wait_for_condition(self, method, timeout=30):
         timeout = float(timeout) + time.time()
         while time.time() < timeout:
             value = method(self.marionette)
             if value: