Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-consider how run_info is discovered #49771

Open
gsnedders opened this issue Dec 19, 2024 · 0 comments
Open

Re-consider how run_info is discovered #49771

gsnedders opened this issue Dec 19, 2024 · 0 comments
Labels
infra wptrunner The automated test runner, commonly called through ./wpt run

Comments

@gsnedders
Copy link
Member

wptrunner.wpttest.RunInfo is used all over the place, but it currently assumes that it is either being run on the machine the info is being gathered for or that it knows how to override what it finds for the current machine. This seems silly, because this means wpttest needs to knowledge of how to introspect anything a Browser might be running on.

With the amount of logic in here, it feels like it should at least be wptrunner.product.Product.get_run_info if not wptrunner.browsers.base.Browser.get_run_info — though the latter is practically impossible given we need to know the run_info to load tests correctly, which we do before we create any Browser.

Adding support for iOS would result in even more logic living in wpttest, which feels even further wrong.

I think the type, ignoring any RunInfoExtras, is crudely (note this is invalid, mozinfo doesn't actually export type(mozinfo.unknown)` anywhere so we can't actually match it):

from typing import TypedDict, NotRequired


class MozInfoDict(TypedDict):
    apple_catalina: bool
    apple_silicon: bool
    automation: bool
    bits: int
    display: str | None
    has_sandbox: bool
    os: str | type(mozinfo.unknown)
    os_version: str | type(mozinfo.unknown)
    processor: str
    version: str | type(mozinfo.unknown)
    win10_2004: bool
    win10_2009: bool
    win11_2009: bool
    linux_distro: NotRequired[str]


class RunInfoDict(MozInfoDict):
    revision: str | None
    python_version: int
    product: str
    debug: bool
    browser_version: NotRequired[str]
    browser_channel: NotRequired[str]
    verify: bool
    wasm: bool
    headless: bool
    adb_binary: NotRequired[str]
@gsnedders gsnedders added infra wptrunner The automated test runner, commonly called through ./wpt run labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra wptrunner The automated test runner, commonly called through ./wpt run
Projects
None yet
Development

No branches or pull requests

1 participant