Bug 1226381 - Marionette should print real path for profile location; r?automatedtester,maja_zf draft
authorAditya Motwani <adityamotwani@gmail.com>
Tue, 01 Mar 2016 19:44:24 +0530
changeset 335839 35b9d0f0370f9ed19b4b369d13dbfae70cb028e8
parent 335780 a4929411c0aa3ec6b727e2bc2fc050c8199c6573
child 515227 4e1c285b40faac20bb1bf742bb3e05c2bdc124e7
push id11887
push userbmo:adityamotwani@gmail.com
push dateTue, 01 Mar 2016 17:18:50 +0000
reviewersautomatedtester, maja_zf
bugs1226381
milestone47.0a1
Bug 1226381 - Marionette should print real path for profile location; r?automatedtester,maja_zf MozReview-Commit-ID: HOjxrXmnHoa
testing/marionette/client/marionette_driver/marionette.py
testing/marionette/harness/marionette/runner/base.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -633,16 +633,24 @@ class Marionette(object):
             if busybox:
                 self.emulator.install_busybox(busybox=busybox)
             self.emulator.wait_for_system_message(self)
 
         # for callbacks from a protocol level 2 or lower remote,
         # we store the callback ID so it can be used by _send_emulator_result
         self.emulator_callback_id = None
 
+    @property
+    def profile_path(self):
+        if self.instance and self.instance.profile:
+            return self.instance.profile.profile
+        elif self.runner and self.runner.profile:
+            return self.runner.profile.profile
+
+
     def cleanup(self):
         if self.session:
             try:
                 self.delete_session()
             except (errors.MarionetteException, socket.error, IOError):
                 # These exceptions get thrown if the Marionette server
                 # hit an exception/died or the connection died. We can
                 # do no further server-side cleanup in this case.
--- a/testing/marionette/harness/marionette/runner/base.py
+++ b/testing/marionette/harness/marionette/runner/base.py
@@ -619,18 +619,16 @@ class BaseMarionetteTestRunner(object):
 
         # set up test handlers
         self.test_handlers = []
 
         self.reset_test_stats()
 
         self.logger.info('Using workspace for temporary data: '
                          '"{}"'.format(self.workspace_path))
-        if not self.workspace:
-            self.logger.info('Profile destination is TMP')
 
         if self.emulator and not self.logdir:
             self.logdir = os.path.join(self.workspace_path or '', 'logcat')
         if self.logdir and not os.access(self.logdir, os.F_OK):
                 os.mkdir(self.logdir)
 
         if not gecko_log:
             self.gecko_log = os.path.join(self.workspace_path or '', 'gecko.log')
@@ -811,16 +809,18 @@ setReq.onerror = function() {
             self.start_marionette()
             # Retrieve capabilities for later use
             if not self._capabilities:
                 self.capabilities
             # if we're working against a desktop version, we usually don't need
             # an external ip
             if self._capabilities['device'] == "desktop":
                 need_external_ip = False
+        self.logger.info('Initial Profile Destination is '
+                         '"{}"'.format(self.marionette.profile_path))
 
         # Gaia sets server_root and that means we shouldn't spin up our own httpd
         if not self.httpd:
             if self.server_root is None or os.path.isdir(self.server_root):
                 self.logger.info("starting httpd")
                 self.start_httpd(need_external_ip)
                 self.marionette.baseurl = self.httpd.get_url()
                 self.logger.info("running httpd on %s" % self.marionette.baseurl)
@@ -1103,9 +1103,9 @@ setReq.onerror = function() {
 
     def cleanup(self):
         if self.httpd:
             self.httpd.stop()
 
         if self.marionette:
             self.marionette.cleanup()
 
-    __del__ = cleanup
\ No newline at end of file
+    __del__ = cleanup