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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration_tests/wasm/test/hello_world_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@TestOn('wasm')
// TODO: https://github.com/dart-lang/test/issues/2288
@OnPlatform({'firefox': Skip()})
@OnPlatform({'windows && firefox': Skip()})
// This retry is a regression test for https://github.com/dart-lang/test/issues/2006
@Retry(2)
library;
Expand Down
3 changes: 3 additions & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 1.25.15-wip

* Support using the OS platform selector to configure browser tests.
TODO: Longer changelog with potential impacts.

## 1.25.14

* Use secure random for url secrets.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ dependencies:
stream_channel: ^2.1.0

# Use an exact version until the test_api and test_core package are stable.
test_api: 0.7.4
test_core: 0.6.8
test_api: 0.7.5-wip
test_core: 0.6.9-wip

typed_data: ^1.3.0
web_socket_channel: '>=2.0.0 <4.0.0'
Expand Down
2 changes: 2 additions & 0 deletions pkgs/test_api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.7.5-wip

## 0.7.4

* Allow `analyzer: '>=6.0.0 <8.0.0'`
Expand Down
3 changes: 0 additions & 3 deletions pkgs/test_api/lib/src/backend/suite_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.

throw ArgumentError('No OS should be passed for runtime "$runtime".');
}
if (!runtime.supportedCompilers.contains(this.compiler)) {
throw ArgumentError(
'The platform $runtime does not support the compiler ${this.compiler}');
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test_api/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_api
version: 0.7.4
version: 0.7.5-wip
description: >-
The user facing API for structuring Dart tests and checking expectations.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api
Expand Down
2 changes: 2 additions & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.6.9-wip

## 0.6.8

* Fix hang when running multiple precompiled browser tests.
Expand Down
10 changes: 6 additions & 4 deletions pkgs/test_core/lib/src/util/io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ final currentOS = OperatingSystem.findByIoName(Platform.operatingSystem);
/// [OperatingSystem.none].
// TODO: https://github.com/dart-lang/test/issues/2119 - require compiler
SuitePlatform currentPlatform(Runtime runtime, [Compiler? compiler]) =>
SuitePlatform(runtime,
compiler: compiler,
os: runtime.isBrowser ? OperatingSystem.none : currentOS,
inGoogle: inGoogle);
SuitePlatform(
runtime,
compiler: compiler,
os: currentOS,
inGoogle: inGoogle,
);

/// A transformer that decodes bytes using UTF-8 and splits them on newlines.
final lineSplitter = StreamTransformer<List<int>, String>(
Expand Down
4 changes: 2 additions & 2 deletions pkgs/test_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_core
version: 0.6.8
version: 0.6.9-wip
description: A basic library for writing tests and running them on the VM.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core
resolution: workspace
Expand Down Expand Up @@ -27,7 +27,7 @@ dependencies:
stack_trace: ^1.10.0
stream_channel: ^2.1.0
# Use an exact version until the test_api package is stable.
test_api: 0.7.4
test_api: 0.7.5-wip
vm_service: ">=6.0.0 <16.0.0"
yaml: ^3.0.0

Expand Down
Loading