Bug 1115338 - ./mach mochitest-browser path/to/individual/test should always run test (despite skip-if/run-if conditions in manifest). r=jmaher
authorKaustabh Datta Choudhury <kaustabh93@gmail.com>
Tue, 06 Jan 2015 01:16:13 +0530
changeset 248085 3595d450fac19f74f8ba272f13ef66769611ed38
parent 248084 f3c7e9a00af88d87187eb2e8062fb3edaf684fcf
child 248086 ce30926721eb3fc88bf65ea9efc6b2331fcf5eda
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1115338
milestone37.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 1115338 - ./mach mochitest-browser path/to/individual/test should always run test (despite skip-if/run-if conditions in manifest). r=jmaher
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1619,17 +1619,16 @@ class Mochitest(MochitestUtilsMixin):
     self.urlOpts = []
 
   def getActiveTests(self, options, disabled=True):
     """
       This method is used to parse the manifest and return active filtered tests.
     """
     self.setTestRoot(options)
     manifest = self.getTestManifest(options)
-
     if manifest:
       # Python 2.6 doesn't allow unicode keys to be used for keyword
       # arguments. This gross hack works around the problem until we
       # rid ourselves of 2.6.
       info = {}
       for k, v in mozinfo.info.items():
         if isinstance(k, unicode):
           k = k.encode('ascii')
@@ -1640,23 +1639,30 @@ class Mochitest(MochitestUtilsMixin):
       testPath = testPath.replace('\\', '/')
       if testPath.endswith('.html') or \
          testPath.endswith('.xhtml') or \
          testPath.endswith('.xul') or \
          testPath.endswith('.js'):
           # In the case where we have a single file, we don't want to filter based on options such as subsuite.
           tests = manifest.active_tests(disabled=disabled, options=None, **info)
           for test in tests:
-              if 'disabled' in test:
-                  del test['disabled']
+            if 'disabled' in test:
+              del test['disabled']
+
       else:
-          tests = manifest.active_tests(disabled=disabled, options=options, **info)
+        tests = manifest.active_tests(disabled=disabled, options=options, **info)
+        if len(tests) == 0:
+          tests = manifest.active_tests(disabled=True, options=options, **info)
+
     paths = []
 
     for test in tests:
+      if len(tests) == 1 and 'disabled' in test:
+        del test['disabled']
+
       pathAbs = os.path.abspath(test['path'])
       assert pathAbs.startswith(self.testRootAbs)
       tp = pathAbs[len(self.testRootAbs):].replace('\\', '/').strip('/')
 
       # Filter out tests if we are using --test-path
       if testPath and not tp.startswith(testPath):
         continue