Remove references to 2020 layout in try_parser.py (#36047)

* Remove references to 2020 layout in try_parser.py

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>

* Removed all references to CHANGE

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>

* Updated .yml workflow files

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>

* update more references

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>

* fixed right hand argument

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>

* Fixing more references

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>

* mach: remove unused import in try_parser.py

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* ci: update reference to wpt_layout in try.yml

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
MDCODE247 2025-03-25 12:19:48 +01:00 committed by GitHub
parent cee84c824f
commit 3b293f4949
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 40 additions and 64 deletions

View file

@ -11,9 +11,9 @@ on:
wpt-args: wpt-args:
required: true required: true
type: string type: string
wpt-layout: wpt:
required: true required: true
type: string type: boolean
unit-tests: unit-tests:
required: true required: true
type: boolean type: boolean
@ -43,7 +43,7 @@ jobs:
secrets: inherit secrets: inherit
with: with:
profile: ${{ inputs.profile }} profile: ${{ inputs.profile }}
wpt-layout: ${{ inputs.wpt-layout }} wpt: ${{ inputs.wpt }}
unit-tests: ${{ inputs.unit-tests }} unit-tests: ${{ inputs.unit-tests }}
build-libservo: ${{ inputs.build-libservo }} build-libservo: ${{ inputs.build-libservo }}
wpt-args: ${{ inputs.wpt-args }} wpt-args: ${{ inputs.wpt-args }}
@ -56,7 +56,7 @@ jobs:
secrets: inherit secrets: inherit
with: with:
profile: ${{ inputs.profile }} profile: ${{ inputs.profile }}
wpt-layout: ${{ inputs.wpt-layout }} wpt: ${{ inputs.wpt }}
unit-tests: ${{ inputs.unit-tests }} unit-tests: ${{ inputs.unit-tests }}
build-libservo: ${{ inputs.build-libservo }} build-libservo: ${{ inputs.build-libservo }}
wpt-args: ${{ inputs.wpt-args }} wpt-args: ${{ inputs.wpt-args }}

View file

@ -14,9 +14,9 @@ on:
required: false required: false
default: false default: false
type: boolean type: boolean
wpt-layout: wpt:
required: false required: false
type: string type: boolean
unit-tests: unit-tests:
required: false required: false
default: false default: false
@ -55,10 +55,9 @@ on:
default: false default: false
required: false required: false
type: boolean type: boolean
wpt-layout: wpt:
required: false required: false
type: choice type: boolean
options: ["none", "2020", "all"]
unit-tests: unit-tests:
required: false required: false
default: false default: false
@ -216,7 +215,7 @@ jobs:
path: target.tar.gz path: target.tar.gz
wpt-2020: wpt-2020:
if: ${{ inputs.wpt-layout == '2020' || inputs.wpt-layout == 'all' }} if: ${{ inputs.wpt }}
name: Linux WPT name: Linux WPT
needs: ["build"] needs: ["build"]
uses: ./.github/workflows/linux-wpt.yml uses: ./.github/workflows/linux-wpt.yml

View file

@ -11,9 +11,9 @@ on:
default: "" default: ""
required: false required: false
type: string type: string
wpt-layout: wpt:
required: false required: false
type: string type: boolean
unit-tests: unit-tests:
required: false required: false
default: false default: false
@ -48,10 +48,9 @@ on:
default: "" default: ""
required: false required: false
type: string type: string
wpt-layout: wpt:
required: false required: false
type: choice type: boolean
options: ["none", "2020", "all"]
unit-tests: unit-tests:
required: false required: false
default: false default: false
@ -206,7 +205,7 @@ jobs:
path: target.tar.gz path: target.tar.gz
wpt-2020: wpt-2020:
if: ${{ inputs.wpt-layout == '2020' || inputs.wpt-layout == 'all' }} if: ${{ inputs.wpt }}
name: MacOS WPT name: MacOS WPT
needs: ["build"] needs: ["build"]
uses: ./.github/workflows/mac-wpt.yml uses: ./.github/workflows/mac-wpt.yml

View file

@ -51,7 +51,7 @@ jobs:
secrets: inherit secrets: inherit
with: with:
workflow: ${{ matrix.workflow }} workflow: ${{ matrix.workflow }}
wpt-layout: ${{ matrix.wpt_layout }} wpt: ${{ matrix.wpt }}
profile: ${{ matrix.profile }} profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }} unit-tests: ${{ matrix.unit_tests }}
build-libservo: ${{ matrix.build_libservo }} build-libservo: ${{ matrix.build_libservo }}

View file

@ -16,7 +16,7 @@ jobs:
uses: ./.github/workflows/linux.yml uses: ./.github/workflows/linux.yml
with: with:
wpt-sync-from-upstream: true wpt-sync-from-upstream: true
wpt-layout: 'all' wpt: true
unit-tests: false unit-tests: false
sync: sync:

View file

@ -123,7 +123,7 @@ jobs:
secrets: inherit secrets: inherit
with: with:
workflow: ${{ matrix.workflow }} workflow: ${{ matrix.workflow }}
wpt-layout: ${{ matrix.wpt_layout }} wpt: ${{ matrix.wpt }}
profile: ${{ matrix.profile }} profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }} unit-tests: ${{ matrix.unit_tests }}
build-libservo: ${{ matrix.build_libservo }} build-libservo: ${{ matrix.build_libservo }}

View file

@ -14,10 +14,9 @@ on:
default: "" default: ""
required: false required: false
type: string type: string
wpt-layout: wpt:
required: false required: false
type: choice type: boolean
options: ["none", "2020", "all"]
unit-tests: unit-tests:
required: false required: false
type: boolean type: boolean
@ -78,7 +77,7 @@ jobs:
// Process `workflow_dispatch` provided configuration overrides. // Process `workflow_dispatch` provided configuration overrides.
if (context.eventName == "workflow_dispatch") { if (context.eventName == "workflow_dispatch") {
// WPT-related overrides only affect Linux currently, as tests don't run by default on other platforms. // 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 }}" || ""; configuration.matrix[0].wpt_args = "${{ inputs.wpt-args }}" || "";
let unit_tests = Boolean(${{ inputs.unit-tests }}); let unit_tests = Boolean(${{ inputs.unit-tests }});
@ -104,7 +103,7 @@ jobs:
secrets: inherit secrets: inherit
with: with:
workflow: ${{ matrix.workflow }} workflow: ${{ matrix.workflow }}
wpt-layout: ${{ matrix.wpt_layout }} wpt: ${{ matrix.wpt }}
profile: ${{ matrix.profile }} profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }} unit-tests: ${{ matrix.unit_tests }}
build-libservo: ${{ matrix.build_libservo }} build-libservo: ${{ matrix.build_libservo }}

View file

@ -18,24 +18,7 @@ import unittest
import logging import logging
from dataclasses import dataclass from dataclasses import dataclass
from enum import Enum, Flag, auto from enum import Enum
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"
class Workflow(str, Enum): class Workflow(str, Enum):
@ -51,7 +34,7 @@ class Workflow(str, Enum):
class JobConfig(object): class JobConfig(object):
name: str name: str
workflow: Workflow = Workflow.LINUX workflow: Workflow = Workflow.LINUX
wpt_layout: Layout = Layout.none wpt: bool = False
profile: str = "release" profile: str = "release"
unit_tests: bool = False unit_tests: bool = False
build_libservo: bool = False build_libservo: bool = False
@ -68,7 +51,7 @@ class JobConfig(object):
if getattr(self, field) != getattr(other, field): if getattr(self, field) != getattr(other, field):
return False return False
self.wpt_layout |= other.wpt_layout self.wpt |= other.wpt
self.unit_tests |= other.unit_tests self.unit_tests |= other.unit_tests
self.build_libservo |= other.build_libservo self.build_libservo |= other.build_libservo
self.bencher |= other.bencher self.bencher |= other.bencher
@ -93,7 +76,7 @@ class JobConfig(object):
modifier.append("Unit Tests") modifier.append("Unit Tests")
if self.build_libservo: if self.build_libservo:
modifier.append("Build libservo") modifier.append("Build libservo")
if self.wpt_layout != Layout.none: if self.wpt:
modifier.append("WPT") modifier.append("WPT")
if self.bencher: if self.bencher:
modifier.append("Bencher") modifier.append("Bencher")
@ -116,7 +99,7 @@ def handle_preset(s: str) -> Optional[JobConfig]:
return JobConfig("OpenHarmony", Workflow.OHOS) return JobConfig("OpenHarmony", Workflow.OHOS)
elif any(word in s for word in ["webgpu"]): elif any(word in s for word in ["webgpu"]):
return JobConfig("WebGPU CTS", Workflow.LINUX, 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 wpt_args="_webgpu", # run only webgpu cts
profile="production", # WebGPU works to slow with debug assert profile="production", # WebGPU works to slow with debug assert
unit_tests=False) # production profile does not work with unit-tests 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" config.profile = "production"
if "bencher" in s: if "bencher" in s:
config.bencher = True config.bencher = True
elif "wpt-2020" in s:
config.wpt_layout = Layout.layout2020
elif "wpt" in s: elif "wpt" in s:
config.wpt_layout = Layout.all() config.wpt = True
config.update_name() config.update_name()
return config return config
@ -150,8 +131,6 @@ class Encoder(json.JSONEncoder):
def default(self, o): def default(self, o):
if isinstance(o, (Config, JobConfig)): if isinstance(o, (Config, JobConfig)):
return o.__dict__ return o.__dict__
if isinstance(o, Layout):
return o.to_string()
return json.JSONEncoder.default(self, o) return json.JSONEncoder.default(self, o)
@ -176,7 +155,7 @@ class Config(object):
self.fail_fast = True self.fail_fast = True
continue # skip over keyword continue # skip over keyword
if word == "full": 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"]) words.extend(["macos-unit-tests", "windows-unit-tests", "android", "ohos", "lint"])
continue # skip over keyword continue # skip over keyword
if word == "bencher": if word == "bencher":
@ -223,7 +202,7 @@ class TestParser(unittest.TestCase):
'unit_tests': True, 'unit_tests': True,
'build_libservo': False, 'build_libservo': False,
'workflow': 'linux', 'workflow': 'linux',
'wpt_layout': 'none', 'wpt': False,
'wpt_args': '' 'wpt_args': ''
}] }]
}) })
@ -234,7 +213,7 @@ class TestParser(unittest.TestCase):
{ {
"name": "Linux (Unit Tests, WPT, Bencher)", "name": "Linux (Unit Tests, WPT, Bencher)",
"workflow": "linux", "workflow": "linux",
"wpt_layout": "all", "wpt": True,
"profile": "release", "profile": "release",
"unit_tests": True, "unit_tests": True,
'build_libservo': False, 'build_libservo': False,
@ -244,7 +223,7 @@ class TestParser(unittest.TestCase):
{ {
"name": "MacOS (Unit Tests)", "name": "MacOS (Unit Tests)",
"workflow": "macos", "workflow": "macos",
"wpt_layout": "none", "wpt": False,
"profile": "release", "profile": "release",
"unit_tests": True, "unit_tests": True,
'build_libservo': False, 'build_libservo': False,
@ -254,7 +233,7 @@ class TestParser(unittest.TestCase):
{ {
"name": "Windows (Unit Tests)", "name": "Windows (Unit Tests)",
"workflow": "windows", "workflow": "windows",
"wpt_layout": "none", "wpt": False,
"profile": "release", "profile": "release",
"unit_tests": True, "unit_tests": True,
'build_libservo': False, 'build_libservo': False,
@ -264,7 +243,7 @@ class TestParser(unittest.TestCase):
{ {
"name": "Android", "name": "Android",
"workflow": "android", "workflow": "android",
"wpt_layout": "none", "wpt": False,
"profile": "release", "profile": "release",
"unit_tests": False, "unit_tests": False,
'build_libservo': False, 'build_libservo': False,
@ -274,7 +253,7 @@ class TestParser(unittest.TestCase):
{ {
"name": "OpenHarmony", "name": "OpenHarmony",
"workflow": "ohos", "workflow": "ohos",
"wpt_layout": "none", "wpt": False,
"profile": "release", "profile": "release",
"unit_tests": False, "unit_tests": False,
'build_libservo': False, 'build_libservo': False,
@ -284,7 +263,7 @@ class TestParser(unittest.TestCase):
{ {
"name": "Lint", "name": "Lint",
"workflow": "lint", "workflow": "lint",
"wpt_layout": "none", "wpt": False,
"profile": "release", "profile": "release",
"unit_tests": False, "unit_tests": False,
'build_libservo': False, 'build_libservo': False,
@ -293,7 +272,7 @@ class TestParser(unittest.TestCase):
]}) ]})
def test_job_merging(self): 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, {'fail_fast': False,
'matrix': [{ 'matrix': [{
'bencher': False, 'bencher': False,
@ -302,7 +281,7 @@ class TestParser(unittest.TestCase):
'unit_tests': False, 'unit_tests': False,
'build_libservo': False, 'build_libservo': False,
'workflow': 'linux', 'workflow': 'linux',
'wpt_layout': 'all', 'wpt': True,
'wpt_args': '' 'wpt_args': ''
}] }]
}) })
@ -314,11 +293,11 @@ class TestParser(unittest.TestCase):
a = handle_preset("linux-unit-tests") a = handle_preset("linux-unit-tests")
a = handle_modifier(a, "linux-unit-tests") a = handle_modifier(a, "linux-unit-tests")
b = handle_preset("linux-wpt-2020") b = handle_preset("linux-wpt")
b = handle_modifier(b, "linux-wpt-2020") b = handle_modifier(b, "linux-wpt")
self.assertTrue(a.merge(b), "Should merge jobs that have different unit test configurations.") self.assertTrue(a.merge(b), "Should merge jobs that have different unit test configurations.")
self.assertEqual(a, JobConfig("Linux (Unit Tests, WPT)", Workflow.LINUX, 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) a = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True)
b = JobConfig("Mac", Workflow.MACOS, unit_tests=True) b = JobConfig("Mac", Workflow.MACOS, unit_tests=True)