Skip to content

Commit

Permalink
Run package:test tests on mac (#2280)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
natebosch authored Sep 11, 2024
1 parent 569c6eb commit 9a2d155
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 19 deletions.
208 changes: 199 additions & 9 deletions .github/workflows/dart.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkgs/test/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,30 @@ stages:
- command: dart test --preset travis --total-shards 5 --shard-index 0
os:
- windows
- osx
sdk:
- pubspec
- command: dart test --preset travis --total-shards 5 --shard-index 1
os:
- windows
- osx
sdk:
- pubspec
- command: dart test --preset travis --total-shards 5 --shard-index 2
os:
- windows
- osx
sdk:
- pubspec
- command: dart test --preset travis --total-shards 5 --shard-index 3
os:
- windows
- osx
sdk:
- pubspec
- command: dart test --preset travis --total-shards 5 --shard-index 4
os:
- windows
- osx
sdk:
- pubspec
6 changes: 4 additions & 2 deletions pkgs/test/test/runner/browser/safari_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import 'code_server.dart';
void main() {
setUpAll(precompileTestExecutable);

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

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

test('can run successful tests', () async {
test('can run successful tests',
skip: 'https://github.com/dart-lang/test/issues/1253', () async {
await d.file('test.dart', '''
import 'package:test/test.dart';
Expand Down
21 changes: 13 additions & 8 deletions pkgs/test/test/runner/compiler_runtime_matrix_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@ void main() {
(runtime == Runtime.safari && !Platform.isMacOS)) {
continue;
}
String? skipReason;
if (runtime == Runtime.safari) {
skipReason = 'https://github.com/dart-lang/test/issues/1253';
} else if (compiler == Compiler.dart2wasm) {
skipReason = 'Wasm tests are experimental and require special setup';
} else if ([Runtime.firefox, Runtime.nodeJS].contains(runtime) &&
Platform.isWindows) {
skipReason = 'https://github.com/dart-lang/test/issues/1942';
} else if (runtime == Runtime.firefox && Platform.isMacOS) {
skipReason = 'https://github.com/dart-lang/test/pull/2276';
}
group('--runtime ${runtime.identifier} --compiler ${compiler.identifier}',
() {
skip: skipReason, () {
final testArgs = [
'test.dart',
'-p',
Expand Down Expand Up @@ -112,13 +123,7 @@ void main() {
? 'https://github.com/dart-lang/test/issues/2150'
: null);
}
},
skip: compiler == Compiler.dart2wasm
? 'Wasm tests are experimental and require special setup'
: [Runtime.firefox, Runtime.nodeJS].contains(runtime) &&
Platform.isWindows
? 'https://github.com/dart-lang/test/issues/1942'
: null);
});
}
}
}
Expand Down

0 comments on commit 9a2d155

Please sign in to comment.