-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add a SuitePlatform class #778
Conversation
This encapsulates all the information about the platform on which a suite runs, and which platform selectors can select for. Currently it just includes the runtime and the operating system, but eventually it could include whether we're running internally to Google, or which compiler is in use.
This clarifies the distinction between TestPlatform and SuitePlatform, and uses a more specific word rather than a more general one. Unfortunately, it does mean that we have some user-facing interfaces (the --platform flag, the override_platforms and define_platforms configuration fields) that now use different terminology than the test runner. It would be possible to migrate those to refer to "runtime" as well, but seeing as --platform in particular is very widely-used *and* matches up nicely with --preset (-p vs -P) I'm inclined to think it's not worth the effort.
|
||
/// The operating system on which the suite is running. | ||
/// | ||
/// This will always be [OperatingSystem.none] if `runtime.isBrowser` is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add another value to operating system that is 'Browser'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just what "none" means. I like the term "none" though, since it's future-proof for other platforms that may be OS-independent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
@@ -65,7 +65,7 @@ final ArgParser _parser = (() { | |||
abbr: 'p', | |||
help: 'The platform(s) on which to run the tests.\n' | |||
'[vm (default), ' | |||
'${allPlatforms.map((platform) => platform.identifier).join(", ")}]', | |||
'${allRuntimes.map((runtime) => runtime.identifier).join(", ")}]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add some internal comments here stating platforms map to runtimes due to historical reasons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
/// The operating system on which the suite is running. | ||
/// | ||
/// This will always be [OperatingSystem.none] if `runtime.isBrowser` is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
This encapsulates all the information about the platform on which a
suite runs, and which platform selectors can select for. Currently it
just includes the runtime and the operating system, but eventually it
could include whether we're running internally to Google, or which
compiler is in use.
This also renames
TestPlatform
toRuntime
, which clarifies thedistinction between
TestPlatform
andSuitePlatform
, and uses amore specific word rather than a more general one. Unfortunately, it
does mean that we have some user-facing interfaces (the
--platform
flag, the
override_platforms
anddefine_platforms
configurationfields) that now use different terminology than the test runner.
It would be possible to migrate those to refer to "runtime" as well,
but seeing as
--platform
in particular is very widely-used andmatches up nicely with
--preset
(-p
vs-P
) I'm inclined to thinkit's not worth the effort.