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

Add a SuitePlatform class #778

Merged
merged 4 commits into from
Feb 27, 2018
Merged

Add a SuitePlatform class #778

merged 4 commits into from
Feb 27, 2018

Conversation

nex3
Copy link
Member

@nex3 nex3 commented Feb 27, 2018

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 to Runtime, which 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.

nex3 added 3 commits February 26, 2018 17:23
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.
@nex3 nex3 requested a review from grouma February 27, 2018 01:26

/// The operating system on which the suite is running.
///
/// This will always be [OperatingSystem.none] if `runtime.isBrowser` is
Copy link
Member

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'?

Copy link
Member Author

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.

Copy link
Member

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(", ")}]',
Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

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

Fair enough.

@nex3 nex3 merged commit d48d6a8 into master Feb 27, 2018
@nex3 nex3 deleted the suite-platform branch March 13, 2018 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants