diff --git a/.github/workflows/dispatch-workflow.yml b/.github/workflows/dispatch-workflow.yml index 8688b96d76c..c938b1acd39 100644 --- a/.github/workflows/dispatch-workflow.yml +++ b/.github/workflows/dispatch-workflow.yml @@ -11,9 +11,9 @@ on: wpt-args: required: true type: string - wpt-layout: + wpt: required: true - type: string + type: boolean unit-tests: required: true type: boolean @@ -43,7 +43,7 @@ jobs: secrets: inherit with: profile: ${{ inputs.profile }} - wpt-layout: ${{ inputs.wpt-layout }} + wpt: ${{ inputs.wpt }} unit-tests: ${{ inputs.unit-tests }} build-libservo: ${{ inputs.build-libservo }} wpt-args: ${{ inputs.wpt-args }} @@ -56,7 +56,7 @@ jobs: secrets: inherit with: profile: ${{ inputs.profile }} - wpt-layout: ${{ inputs.wpt-layout }} + wpt: ${{ inputs.wpt }} unit-tests: ${{ inputs.unit-tests }} build-libservo: ${{ inputs.build-libservo }} wpt-args: ${{ inputs.wpt-args }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fb677ff6a14..b8914a2e810 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,9 +14,9 @@ on: required: false default: false type: boolean - wpt-layout: + wpt: required: false - type: string + type: boolean unit-tests: required: false default: false @@ -55,10 +55,9 @@ on: default: false required: false type: boolean - wpt-layout: + wpt: required: false - type: choice - options: ["none", "2020", "all"] + type: boolean unit-tests: required: false default: false @@ -216,7 +215,7 @@ jobs: path: target.tar.gz wpt-2020: - if: ${{ inputs.wpt-layout == '2020' || inputs.wpt-layout == 'all' }} + if: ${{ inputs.wpt }} name: Linux WPT needs: ["build"] uses: ./.github/workflows/linux-wpt.yml diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 41fb70eab83..e27c0a54180 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -11,9 +11,9 @@ on: default: "" required: false type: string - wpt-layout: + wpt: required: false - type: string + type: boolean unit-tests: required: false default: false @@ -48,10 +48,9 @@ on: default: "" required: false type: string - wpt-layout: + wpt: required: false - type: choice - options: ["none", "2020", "all"] + type: boolean unit-tests: required: false default: false @@ -206,7 +205,7 @@ jobs: path: target.tar.gz wpt-2020: - if: ${{ inputs.wpt-layout == '2020' || inputs.wpt-layout == 'all' }} + if: ${{ inputs.wpt }} name: MacOS WPT needs: ["build"] uses: ./.github/workflows/mac-wpt.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4398e2f58cb..c2bda1a7c2c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,7 @@ jobs: secrets: inherit with: workflow: ${{ matrix.workflow }} - wpt-layout: ${{ matrix.wpt_layout }} + wpt: ${{ matrix.wpt }} profile: ${{ matrix.profile }} unit-tests: ${{ matrix.unit_tests }} build-libservo: ${{ matrix.build_libservo }} diff --git a/.github/workflows/scheduled-wpt-import.yml b/.github/workflows/scheduled-wpt-import.yml index b70749f4797..aa842863d0e 100644 --- a/.github/workflows/scheduled-wpt-import.yml +++ b/.github/workflows/scheduled-wpt-import.yml @@ -16,7 +16,7 @@ jobs: uses: ./.github/workflows/linux.yml with: wpt-sync-from-upstream: true - wpt-layout: 'all' + wpt: true unit-tests: false sync: diff --git a/.github/workflows/try-label.yml b/.github/workflows/try-label.yml index 046b3370b4f..5444b75a4bd 100644 --- a/.github/workflows/try-label.yml +++ b/.github/workflows/try-label.yml @@ -123,7 +123,7 @@ jobs: secrets: inherit with: workflow: ${{ matrix.workflow }} - wpt-layout: ${{ matrix.wpt_layout }} + wpt: ${{ matrix.wpt }} profile: ${{ matrix.profile }} unit-tests: ${{ matrix.unit_tests }} build-libservo: ${{ matrix.build_libservo }} diff --git a/.github/workflows/try.yml b/.github/workflows/try.yml index 853d791d716..274ad7483ff 100644 --- a/.github/workflows/try.yml +++ b/.github/workflows/try.yml @@ -14,10 +14,9 @@ on: default: "" required: false type: string - wpt-layout: + wpt: required: false - type: choice - options: ["none", "2020", "all"] + type: boolean unit-tests: required: false type: boolean @@ -78,7 +77,7 @@ jobs: // Process `workflow_dispatch` provided configuration overrides. if (context.eventName == "workflow_dispatch") { // WPT-related overrides only affect Linux currently, as tests don't run by default on other platforms. - configuration.matrix[0].wpt_layout = "${{ inputs.wpt-layout }}" || "none"; + configuration.matrix[0].wpt = Boolean(${{ inputs.wpt }}); configuration.matrix[0].wpt_args = "${{ inputs.wpt-args }}" || ""; let unit_tests = Boolean(${{ inputs.unit-tests }}); @@ -104,7 +103,7 @@ jobs: secrets: inherit with: workflow: ${{ matrix.workflow }} - wpt-layout: ${{ matrix.wpt_layout }} + wpt: ${{ matrix.wpt }} profile: ${{ matrix.profile }} unit-tests: ${{ matrix.unit_tests }} build-libservo: ${{ matrix.build_libservo }} diff --git a/python/servo/try_parser.py b/python/servo/try_parser.py index 04691a83d0c..edbea49ce7b 100644 --- a/python/servo/try_parser.py +++ b/python/servo/try_parser.py @@ -18,24 +18,7 @@ import unittest import logging from dataclasses import dataclass -from enum import Enum, Flag, auto - - -class Layout(Flag): - none = 0 - layout2020 = auto() - - @staticmethod - def all(): - return Layout.layout2020 - - def to_string(self): - if Layout.all() in self: - return "all" - elif Layout.layout2020 in self: - return "2020" - else: - return "none" +from enum import Enum class Workflow(str, Enum): @@ -51,7 +34,7 @@ class Workflow(str, Enum): class JobConfig(object): name: str workflow: Workflow = Workflow.LINUX - wpt_layout: Layout = Layout.none + wpt: bool = False profile: str = "release" unit_tests: bool = False build_libservo: bool = False @@ -68,7 +51,7 @@ class JobConfig(object): if getattr(self, field) != getattr(other, field): return False - self.wpt_layout |= other.wpt_layout + self.wpt |= other.wpt self.unit_tests |= other.unit_tests self.build_libservo |= other.build_libservo self.bencher |= other.bencher @@ -93,7 +76,7 @@ class JobConfig(object): modifier.append("Unit Tests") if self.build_libservo: modifier.append("Build libservo") - if self.wpt_layout != Layout.none: + if self.wpt: modifier.append("WPT") if self.bencher: modifier.append("Bencher") @@ -116,7 +99,7 @@ def handle_preset(s: str) -> Optional[JobConfig]: return JobConfig("OpenHarmony", Workflow.OHOS) elif any(word in s for word in ["webgpu"]): return JobConfig("WebGPU CTS", Workflow.LINUX, - wpt_layout=Layout.layout2020, # reftests are mode for new layout + wpt=True, # reftests are mode for new layout wpt_args="_webgpu", # run only webgpu cts profile="production", # WebGPU works to slow with debug assert unit_tests=False) # production profile does not work with unit-tests @@ -138,10 +121,8 @@ def handle_modifier(config: JobConfig, s: str) -> Optional[JobConfig]: config.profile = "production" if "bencher" in s: config.bencher = True - elif "wpt-2020" in s: - config.wpt_layout = Layout.layout2020 elif "wpt" in s: - config.wpt_layout = Layout.all() + config.wpt = True config.update_name() return config @@ -150,8 +131,6 @@ class Encoder(json.JSONEncoder): def default(self, o): if isinstance(o, (Config, JobConfig)): return o.__dict__ - if isinstance(o, Layout): - return o.to_string() return json.JSONEncoder.default(self, o) @@ -176,7 +155,7 @@ class Config(object): self.fail_fast = True continue # skip over keyword if word == "full": - words.extend(["linux-unit-tests", "linux-wpt-2020", "linux-bencher"]) + words.extend(["linux-unit-tests", "linux-wpt", "linux-bencher"]) words.extend(["macos-unit-tests", "windows-unit-tests", "android", "ohos", "lint"]) continue # skip over keyword if word == "bencher": @@ -223,7 +202,7 @@ class TestParser(unittest.TestCase): 'unit_tests': True, 'build_libservo': False, 'workflow': 'linux', - 'wpt_layout': 'none', + 'wpt': False, 'wpt_args': '' }] }) @@ -234,7 +213,7 @@ class TestParser(unittest.TestCase): { "name": "Linux (Unit Tests, WPT, Bencher)", "workflow": "linux", - "wpt_layout": "all", + "wpt": True, "profile": "release", "unit_tests": True, 'build_libservo': False, @@ -244,7 +223,7 @@ class TestParser(unittest.TestCase): { "name": "MacOS (Unit Tests)", "workflow": "macos", - "wpt_layout": "none", + "wpt": False, "profile": "release", "unit_tests": True, 'build_libservo': False, @@ -254,7 +233,7 @@ class TestParser(unittest.TestCase): { "name": "Windows (Unit Tests)", "workflow": "windows", - "wpt_layout": "none", + "wpt": False, "profile": "release", "unit_tests": True, 'build_libservo': False, @@ -264,7 +243,7 @@ class TestParser(unittest.TestCase): { "name": "Android", "workflow": "android", - "wpt_layout": "none", + "wpt": False, "profile": "release", "unit_tests": False, 'build_libservo': False, @@ -274,7 +253,7 @@ class TestParser(unittest.TestCase): { "name": "OpenHarmony", "workflow": "ohos", - "wpt_layout": "none", + "wpt": False, "profile": "release", "unit_tests": False, 'build_libservo': False, @@ -284,7 +263,7 @@ class TestParser(unittest.TestCase): { "name": "Lint", "workflow": "lint", - "wpt_layout": "none", + "wpt": False, "profile": "release", "unit_tests": False, 'build_libservo': False, @@ -293,7 +272,7 @@ class TestParser(unittest.TestCase): ]}) def test_job_merging(self): - self.assertDictEqual(json.loads(Config("linux-wpt-2020").to_json()), + self.assertDictEqual(json.loads(Config("linux-wpt").to_json()), {'fail_fast': False, 'matrix': [{ 'bencher': False, @@ -302,7 +281,7 @@ class TestParser(unittest.TestCase): 'unit_tests': False, 'build_libservo': False, 'workflow': 'linux', - 'wpt_layout': 'all', + 'wpt': True, 'wpt_args': '' }] }) @@ -314,11 +293,11 @@ class TestParser(unittest.TestCase): a = handle_preset("linux-unit-tests") a = handle_modifier(a, "linux-unit-tests") - b = handle_preset("linux-wpt-2020") - b = handle_modifier(b, "linux-wpt-2020") + b = handle_preset("linux-wpt") + b = handle_modifier(b, "linux-wpt") self.assertTrue(a.merge(b), "Should merge jobs that have different unit test configurations.") self.assertEqual(a, JobConfig("Linux (Unit Tests, WPT)", Workflow.LINUX, - unit_tests=True, wpt_layout=Layout.layout2020)) + unit_tests=True, wpt=True)) a = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True) b = JobConfig("Mac", Workflow.MACOS, unit_tests=True)