Skip to content

Commit 9a2d155

Browse files
authored
Run package:test tests on mac (#2280)
This will exercise things like launching browsers (where they are currently working on CI). Add `osx` to the sharded `package:test` tests alongside `windows`. These exercise the majority of OS specific behavior. Skip existing safari tests due to a bug running tests in non-interactive environments. (#1253) Skip existing firefox tests due to a changed executable path. (Planned fix in #2276) Refactor a ternary chain to an if/else chain to add the extra conditions for firefox and safari.
1 parent 569c6eb commit 9a2d155

File tree

4 files changed

+221
-19
lines changed

4 files changed

+221
-19
lines changed

.github/workflows/dart.yml

Lines changed: 199 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/test/mono_pkg.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,30 @@ stages:
2222
- command: dart test --preset travis --total-shards 5 --shard-index 0
2323
os:
2424
- windows
25+
- osx
2526
sdk:
2627
- pubspec
2728
- command: dart test --preset travis --total-shards 5 --shard-index 1
2829
os:
2930
- windows
31+
- osx
3032
sdk:
3133
- pubspec
3234
- command: dart test --preset travis --total-shards 5 --shard-index 2
3335
os:
3436
- windows
37+
- osx
3538
sdk:
3639
- pubspec
3740
- command: dart test --preset travis --total-shards 5 --shard-index 3
3841
os:
3942
- windows
43+
- osx
4044
sdk:
4145
- pubspec
4246
- command: dart test --preset travis --total-shards 5 --shard-index 4
4347
os:
4448
- windows
49+
- osx
4550
sdk:
4651
- pubspec

pkgs/test/test/runner/browser/safari_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import 'code_server.dart';
1818
void main() {
1919
setUpAll(precompileTestExecutable);
2020

21-
test('starts Safari with the given URL', () async {
21+
test('starts Safari with the given URL',
22+
skip: 'https://github.com/dart-lang/test/issues/1253', () async {
2223
var server = await CodeServer.start();
2324

2425
server.handleJavaScript('''
@@ -54,7 +55,8 @@ webSocket.addEventListener("open", function() {
5455
startsWith('Failed to run Safari: $noSuchFileMessage'))));
5556
});
5657

57-
test('can run successful tests', () async {
58+
test('can run successful tests',
59+
skip: 'https://github.com/dart-lang/test/issues/1253', () async {
5860
await d.file('test.dart', '''
5961
import 'package:test/test.dart';
6062

pkgs/test/test/runner/compiler_runtime_matrix_test.dart

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,19 @@ void main() {
2626
(runtime == Runtime.safari && !Platform.isMacOS)) {
2727
continue;
2828
}
29+
String? skipReason;
30+
if (runtime == Runtime.safari) {
31+
skipReason = 'https://github.com/dart-lang/test/issues/1253';
32+
} else if (compiler == Compiler.dart2wasm) {
33+
skipReason = 'Wasm tests are experimental and require special setup';
34+
} else if ([Runtime.firefox, Runtime.nodeJS].contains(runtime) &&
35+
Platform.isWindows) {
36+
skipReason = 'https://github.com/dart-lang/test/issues/1942';
37+
} else if (runtime == Runtime.firefox && Platform.isMacOS) {
38+
skipReason = 'https://github.com/dart-lang/test/pull/2276';
39+
}
2940
group('--runtime ${runtime.identifier} --compiler ${compiler.identifier}',
30-
() {
41+
skip: skipReason, () {
3142
final testArgs = [
3243
'test.dart',
3344
'-p',
@@ -112,13 +123,7 @@ void main() {
112123
? 'https://github.com/dart-lang/test/issues/2150'
113124
: null);
114125
}
115-
},
116-
skip: compiler == Compiler.dart2wasm
117-
? 'Wasm tests are experimental and require special setup'
118-
: [Runtime.firefox, Runtime.nodeJS].contains(runtime) &&
119-
Platform.isWindows
120-
? 'https://github.com/dart-lang/test/issues/1942'
121-
: null);
126+
});
122127
}
123128
}
124129
}

0 commit comments

Comments
 (0)