diff options
author | sagudev <16504129+sagudev@users.noreply.github.com> | 2025-05-12 09:41:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-12 07:41:12 +0000 |
commit | c0339dd360f1a2524554331d93418b0b6e73b300 (patch) | |
tree | f7bfa514fb887172ecfb011bd61ed9e1aca624dc /python | |
parent | 5c9afe4274d3b4efe2f8dd7b970c16d2d7e04b3b (diff) | |
download | servo-c0339dd360f1a2524554331d93418b0b6e73b300.tar.gz servo-c0339dd360f1a2524554331d93418b0b6e73b300.zip |
CI: add `build-args` (#36947)
Add `build-args` input in CI and try_parser job definition so we can
pass own build args to `./mach build`
Testing: There are tests for try parser and I tested CI in my fork.
Fixes: partial fix #36823
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Diffstat (limited to 'python')
-rw-r--r-- | python/servo/try_parser.py | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/python/servo/try_parser.py b/python/servo/try_parser.py index 9a6b31693b0..0d78599c06f 100644 --- a/python/servo/try_parser.py +++ b/python/servo/try_parser.py @@ -39,11 +39,12 @@ class JobConfig(object): unit_tests: bool = False build_libservo: bool = False bencher: bool = False + build_args: str = "" wpt_args: str = "" number_of_wpt_chunks: int = 20 # These are the fields that must match in between two JobConfigs for them to be able to be # merged. If you modify any of the fields above, make sure to update this line as well. - merge_compatibility_fields: ClassVar[List[str]] = ['workflow', 'profile', 'wpt_args'] + merge_compatibility_fields: ClassVar[List[str]] = ['workflow', 'profile', 'wpt_args', 'build_args'] def merge(self, other: JobConfig) -> bool: """Try to merge another job with this job. Returns True if merging is successful @@ -209,7 +210,8 @@ class TestParser(unittest.TestCase): 'build_libservo': False, 'workflow': 'linux', 'wpt': False, - 'wpt_args': '' + 'wpt_args': '', + 'build_args': '' }] }) @@ -225,7 +227,8 @@ class TestParser(unittest.TestCase): "unit_tests": True, 'build_libservo': False, 'bencher': True, - "wpt_args": "" + "wpt_args": "", + 'build_args': '' }, { "name": "MacOS (Unit Tests)", @@ -236,7 +239,8 @@ class TestParser(unittest.TestCase): "unit_tests": True, 'build_libservo': False, 'bencher': False, - "wpt_args": "" + "wpt_args": "", + 'build_args': '' }, { "name": "Windows (Unit Tests)", @@ -247,7 +251,8 @@ class TestParser(unittest.TestCase): "unit_tests": True, 'build_libservo': False, 'bencher': False, - "wpt_args": "" + "wpt_args": "", + 'build_args': '' }, { "name": "Android", @@ -258,7 +263,8 @@ class TestParser(unittest.TestCase): "unit_tests": False, 'build_libservo': False, 'bencher': False, - "wpt_args": "" + "wpt_args": "", + 'build_args': '' }, { "name": "OpenHarmony", @@ -269,7 +275,8 @@ class TestParser(unittest.TestCase): "unit_tests": False, 'build_libservo': False, 'bencher': False, - "wpt_args": "" + "wpt_args": "", + 'build_args': '' }, { "name": "Lint", @@ -280,7 +287,9 @@ class TestParser(unittest.TestCase): "unit_tests": False, 'build_libservo': False, 'bencher': False, - "wpt_args": ""} + "wpt_args": "", + 'build_args': '' + } ]}) def test_job_merging(self): @@ -295,7 +304,8 @@ class TestParser(unittest.TestCase): 'build_libservo': False, 'workflow': 'linux', 'wpt': True, - 'wpt_args': '' + 'wpt_args': '', + 'build_args': '' }] }) @@ -327,6 +337,11 @@ class TestParser(unittest.TestCase): self.assertFalse(a.merge(b), "Should not merge jobs that run different WPT tests.") self.assertEqual(a, JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True)) + a = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True) + b = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True, build_args="--help") + self.assertFalse(a.merge(b), "Should not merge jobs with different build arguments.") + self.assertEqual(a, JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True)) + def test_full(self): self.assertDictEqual(json.loads(Config("full").to_json()), json.loads(Config("").to_json())) |