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

Track the OS for browser platforms #2449

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

natebosch
Copy link
Member

We currently do not allow making configuration using tools like
OnPlatform that is specific to an OS and browser combination. So if
there is a situation where tests don't work on firefox on windows, but
work everywhere else, we cannot express an intent to skip just the
failing tests.

In a usage like OnPlatform({'windows && firefox'}) the selector will
never be true because firefox and windows are mutually exclusive.
It does allow cases like 'windows || firefox' which matches windows VM
tests and firefox everywhere.

Changing this means a change to how existing selectors are evaluated. CI
may be impacted if a package is configuring a skip for an OS expecting
only the VM tests to be skipped on that OS with the browser tests still
running.

Use the new capability to skip a test that is failing on windows firefox
browser.

We currently do not allow making configuration using tools like
`OnPlatform` that is specific to an OS and browser combination. So if
there is a situation where tests don't work on firefox on windows, but
work everywhere else, we cannot express an intent to skip just the
failing tests.

In a usage like `OnPlatform({'windows && firefox'})` the selector will
never be true because `firefox` and `windows` are mutually exclusive.
It does allow cases like `'windows || firefox'` which matches windows VM
tests and firefox everywhere.

Changing this means a change to how existing selectors are evaluated. CI
may be impacted if a package is configuring a skip for an OS expecting
only the VM tests to be skipped on that OS with the browser tests still
running.

Use the new capability to skip a test that is failing on windows firefox
browser.
Copy link

github-actions bot commented Jan 17, 2025

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

@@ -38,9 +38,6 @@ final class SuitePlatform {
this.os = OperatingSystem.none,
this.inGoogle = false})
: compiler = compiler ?? runtime.defaultCompiler {
if (runtime.isBrowser && os != OperatingSystem.none) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this was intentional for some reason so it might be worth dragging up the original PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ArgumentError was added in #778

From that commit it doesn't look like the browser/OS restriction was present prior. The restriction that did exist is that an OS couldn't be non-null if a platform was null.
decc01d#diff-503be8017a1b23c25555e53d9976a7a67da81d39a671a51bd5a6a2eddbf18197L53-L56

I don't see any code in the before on that diff which conditionally added an OS or did anything different on browsers with regards to the OS. The code for resolving the platform selectors looks the same.

@natebosch
Copy link
Member Author

I'm iffy on whether I want to land this, I'm not entirely sure of the risks of changing the value of OS selectors for all configuration of browser tests. The main concern is that packages could be intentionally using the current meaning to skip all VM tests on some OS but run all browser tests on that OS. There is recourse - you can change windows to windows && !browser to get the old meaning, but the effect may go unnoticed if it's just a silent reduction in the number of test suites or cases that are running.

@jakemac53
Copy link
Contributor

jakemac53 commented Jan 17, 2025

I do think its probably a good change... you don't expect windows to exclude browsers on windows. Or, at least I wouldn't expect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants