commit 2717e56d339fc0101cdd48b9c3a80529114e3f65
parent 42b8b77338b2be8c9b9b45301b7582cc67236430
Author: Sebastian Hengst <aryx.github@gmx-topmail.de>
Date: Thu, 30 Oct 2025 16:59:50 +0100
Revert "Bug 1989470 - combine run-if conditions for .toml manifests. r=ci-and-tooling,aryx"
This reverts commit feaf6919f740c88f26d085f75b84fc944b23ecbd.
Diffstat:
5 files changed, 2 insertions(+), 54 deletions(-)
diff --git a/testing/mozbase/manifestparser/manifestparser/filters.py b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -49,12 +49,8 @@ def run_if(tests, values, strict=False):
"""
tag = "run-if"
for test in tests:
- if tag in test:
- # logical &&, not || - find first condition that didn't match
- for e in test[tag].splitlines():
- if e and not parse(e, strict=strict, **values):
- test.setdefault("disabled", f"{tag}: {e}")
- break
+ if tag in test and not _match(test[tag], strict, **values):
+ test.setdefault("disabled", f"{tag}: {test[tag]}")
yield test
diff --git a/testing/mozbase/manifestparser/manifestparser/ini.py b/testing/mozbase/manifestparser/manifestparser/ini.py
@@ -190,7 +190,6 @@ def combine_fields(global_vars, local_vars):
field_patterns = {
"args": "%s %s",
"prefs": "%s\n%s",
- "run-if": "%s\n%s", # consider implicit logical OR: "%s ||\n%s"
"skip-if": "%s\n%s", # consider implicit logical OR: "%s ||\n%s"
"support-files": "%s %s",
"tags": "%s %s",
diff --git a/testing/mozbase/manifestparser/tests/default-runif.toml b/testing/mozbase/manifestparser/tests/default-runif.toml
@@ -1,8 +0,0 @@
-[DEFAULT]
-run-if = "os != 'android'" # a comment
-
-[test7]
-[test8]
-run-if = "!condprof" # another comment
-[test9]
-foo = "bar"
diff --git a/testing/mozbase/manifestparser/tests/test_default_overrides.py b/testing/mozbase/manifestparser/tests/test_default_overrides.py
@@ -79,22 +79,6 @@ class TestDefaultSupportFiles(unittest.TestCase):
self.assertEqual(test["support-files"], expected)
-class TestDefaultRunif(unittest.TestCase):
- """Tests combining support-files field in [DEFAULT] with the value for a test"""
-
- def test_defaults_toml(self):
- default = os.path.join(here, "default-runif.toml")
- parser = ManifestParser(manifests=(default,), use_toml=True)
- expected_supp_files = {
- "test7": "os != 'android'",
- "test8": "os != 'android'\n!condprof",
- "test9": "os != 'android'",
- }
- for test in parser.tests:
- expected = expected_supp_files[test["name"]]
- self.assertEqual(test["run-if"], expected)
-
-
class TestOmitDefaults(unittest.TestCase):
"""Tests passing omit-defaults prevents defaults from propagating to definitions."""
diff --git a/testing/mozbase/manifestparser/tests/test_filters.py b/testing/mozbase/manifestparser/tests/test_filters.py
@@ -170,10 +170,6 @@ def tests(create_tests):
"test8",
{"skip-if": "\nbaz\nfoo == 'bar'\nfoo == 'baz'\nintermittent && debug"},
),
- (
- "test9",
- {"run-if": "os != 'android'\n!condprof"},
- ),
)
@@ -210,25 +206,6 @@ def test_run_if(tests):
assert "disabled" in tests[2]
assert tests[2]["disabled"] == "run-if: foo == 'baz'"
- tests = deepcopy(ref)
- tests = list(run_if(tests, {"os": "android", "condprof": False}))
- assert "disabled" in tests[9]
- assert tests[9]["disabled"] == "run-if: os != 'android'"
-
- tests = deepcopy(ref)
- tests = list(run_if(tests, {"os": "win", "condprof": False}))
- assert "disabled" not in tests[9]
-
- tests = deepcopy(ref)
- tests = list(run_if(tests, {"os": "android", "condprof": True}))
- assert "disabled" in tests[9]
- assert tests[9]["disabled"] == "run-if: os != 'android'"
-
- tests = deepcopy(ref)
- tests = list(run_if(tests, {"os": "win", "condprof": True}))
- assert "disabled" in tests[9]
- assert tests[9]["disabled"] == "run-if: !condprof"
-
def test_fail_if(tests):
ref = deepcopy(tests)