Bug 1465887 - Allow test manifests to skip based on Python version; r?ahal
This patch allows us to enable Python 3 tests and skip any tests that fail so that we can work on adding support for Python 3 without risking regressing any existing support. It will also eventually allow us to skip tests from running against Python 2, when we decide to drop support for it. To skip a test against Python 3, add "skip-if = python == 3" to the [DEFAULT] or test file section of a manifest file.
MozReview-Commit-ID: KYzjW6PQw2Q
--- a/python/mach_commands.py
+++ b/python/mach_commands.py
@@ -117,17 +117,18 @@ class MachCommands(MachCommandBase):
mp.tests.extend(test_objects)
filters = []
if subsuite == 'default':
filters.append(mpf.subsuite(None))
elif subsuite:
filters.append(mpf.subsuite(subsuite))
- tests = mp.active_tests(filters=filters, disabled=False, **mozinfo.info)
+ python = 3 if three else 2
+ tests = mp.active_tests(filters=filters, disabled=False, python=python, **mozinfo.info)
if not tests:
submsg = "for subsuite '{}' ".format(subsuite) if subsuite else ""
message = "TEST-UNEXPECTED-FAIL | No tests collected " + \
"{}(Not in PYTHON_UNITTEST_MANIFESTS?)".format(submsg)
self.log(logging.WARN, 'python-test', {}, message)
return 1