Bug 1179143 - Detect android_version for marionette-webapi tests. r=ato
authorJohn Dai <jdai@mozilla.com>
Mon, 07 Sep 2015 23:49:00 +0200
changeset 293954 298d7dcbda70c49468bab1dbf90c890819cafe20
parent 293953 2e38346f89af2e73dcb0b943fdf31b38b480e153
child 293955 08960e6b65c3ea3dff06124660541652467eb3ed
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1179143
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1179143 - Detect android_version for marionette-webapi tests. r=ato
testing/marionette/client/marionette/runner/base.py
--- a/testing/marionette/client/marionette/runner/base.py
+++ b/testing/marionette/client/marionette/runner/base.py
@@ -738,16 +738,27 @@ setReq.onerror = function() {
                 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)
             else:
                 self.marionette.baseurl = self.server_root
                 self.logger.info("using remote content from %s" % self.marionette.baseurl)
 
+        device_info = None
+        if self.capabilities['device'] != 'desktop' and self.capabilities['browserName'] == 'B2G':
+            dm = get_dm(self.marionette)
+            device_info = dm.getInfo()
+            # Add Android version (SDK level) to mozinfo so that manifest entries
+            # can be conditional on android_version.
+            androidVersion = dm.shellCheckOutput(['getprop', 'ro.build.version.sdk'])
+            self.logger.info(
+                "Android sdk version '%s'; will use this to filter manifests" % androidVersion)
+            mozinfo.info['android_version'] = androidVersion
+
         for test in tests:
             self.add_test(test)
 
         # ensure we have only tests files with names starting with 'test_'
         invalid_tests = \
             [t['filepath'] for t in self.tests
              if not os.path.basename(t['filepath']).startswith('test_')]
         if invalid_tests:
@@ -757,21 +768,16 @@ setReq.onerror = function() {
 
         version_info = mozversion.get_version(binary=self.bin,
                                               sources=self.sources,
                                               dm_type=os.environ.get('DM_TRANS', 'adb'),
                                               device_serial=self.device_serial,
                                               adb_host=self.marionette.adb_host,
                                               adb_port=self.marionette.adb_port)
 
-        device_info = None
-        if self.capabilities['device'] != 'desktop' and self.capabilities['browserName'] == 'B2G':
-            dm = get_dm(self.marionette)
-            device_info = dm.getInfo()
-
         self.logger.suite_start(self.tests,
                                 version_info=version_info,
                                 device_info=device_info)
 
         for test in self.manifest_skipped_tests:
             name = os.path.basename(test['path'])
             self.logger.test_start(name)
             self.logger.test_end(name,