mirror of
https://github.com/flutter/packages.git
synced 2025-06-05 02:52:06 +08:00
[ci] Run web tests in wasm (unit + integration). (#8111)
Adds CI configuration to run web integration tests (in the master channel) compiled to Wasm. It also removes the `build-examples` step from web integration tests, in some isolated testing: | platform tests shard | With build-examples | Without build-examples | |---|-----|-----| | 1 | 30m | 21m | | 2 | 13m | 11m | | 3 | 17m | 10m | ## Issues * Fixes https://github.com/flutter/flutter/issues/151664
This commit is contained in:
@ -337,6 +337,33 @@ test_on: vm && browser
|
||||
);
|
||||
});
|
||||
|
||||
test('runs in Chrome (wasm) when requested for Flutter package', () async {
|
||||
final RepositoryPackage package = createFakePackage(
|
||||
'a_package',
|
||||
packagesDir,
|
||||
isFlutter: true,
|
||||
extraFiles: <String>['test/empty_test.dart'],
|
||||
);
|
||||
|
||||
await runCapturingPrint(
|
||||
runner, <String>['dart-test', '--platform=chrome', '--wasm']);
|
||||
|
||||
expect(
|
||||
processRunner.recordedCalls,
|
||||
orderedEquals(<ProcessCall>[
|
||||
ProcessCall(
|
||||
getFlutterCommand(mockPlatform),
|
||||
const <String>[
|
||||
'test',
|
||||
'--color',
|
||||
'--platform=chrome',
|
||||
'--wasm',
|
||||
],
|
||||
package.path),
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
test('runs in Chrome by default for Flutter plugins that implement web',
|
||||
() async {
|
||||
final RepositoryPackage plugin = createFakePlugin(
|
||||
@ -517,6 +544,33 @@ test_on: vm && browser
|
||||
);
|
||||
});
|
||||
|
||||
test('runs in Chrome (wasm) when requested for Dart package', () async {
|
||||
final RepositoryPackage package = createFakePackage(
|
||||
'package',
|
||||
packagesDir,
|
||||
extraFiles: <String>['test/empty_test.dart'],
|
||||
);
|
||||
|
||||
await runCapturingPrint(
|
||||
runner, <String>['dart-test', '--platform=chrome', '--wasm']);
|
||||
|
||||
expect(
|
||||
processRunner.recordedCalls,
|
||||
orderedEquals(<ProcessCall>[
|
||||
ProcessCall('dart', const <String>['pub', 'get'], package.path),
|
||||
ProcessCall(
|
||||
'dart',
|
||||
const <String>[
|
||||
'run',
|
||||
'test',
|
||||
'--platform=chrome',
|
||||
'--compiler=dart2wasm',
|
||||
],
|
||||
package.path),
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
test('skips running in browser mode if package opts out', () async {
|
||||
final RepositoryPackage package = createFakePackage(
|
||||
'a_package',
|
||||
|
Reference in New Issue
Block a user