Skip to content

Commit 11a9fa8

Browse files
authored
[ci] Run web tests in wasm (unit + integration). (flutter#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 flutter/flutter#151664
1 parent 34d5039 commit 11a9fa8

File tree

26 files changed

+282
-72
lines changed

26 files changed

+282
-72
lines changed

.ci.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,38 @@ targets:
245245
"PACKAGE_SHARDING": "--shardIndex 1 --shardCount 2"
246246
}
247247
248+
# Wasm unit tests in master
249+
- name: Linux_web web_dart_unit_test_wasm_shard_1 master
250+
bringup: true
251+
recipe: packages/packages
252+
timeout: 60
253+
properties:
254+
add_recipes_cq: "true"
255+
target_file: web_dart_unit_tests_wasm.yaml
256+
channel: master
257+
version_file: flutter_master.version
258+
package_sharding: "--shardIndex 0 --shardCount 2"
259+
env_variables: >-
260+
{
261+
"CHANNEL": "master",
262+
"PACKAGE_SHARDING": "--shardIndex 0 --shardCount 2"
263+
}
264+
265+
- name: Linux_web web_dart_unit_test_wasm_shard_2 master
266+
bringup: true
267+
recipe: packages/packages
268+
timeout: 60
269+
properties:
270+
target_file: web_dart_unit_tests_wasm.yaml
271+
channel: master
272+
version_file: flutter_master.version
273+
package_sharding: "--shardIndex 1 --shardCount 2"
274+
env_variables: >-
275+
{
276+
"CHANNEL": "master",
277+
"PACKAGE_SHARDING": "--shardIndex 1 --shardCount 2"
278+
}
279+
248280
- name: Linux analyze master
249281
recipe: packages/packages
250282
timeout: 30
@@ -846,6 +878,7 @@ targets:
846878
"CHANNEL": "stable"
847879
}
848880
881+
# JS integration tests in master
849882
- name: Linux_web web_platform_tests_shard_1 master
850883
recipe: packages/packages
851884
timeout: 60
@@ -888,6 +921,53 @@ targets:
888921
"PACKAGE_SHARDING": "--shardIndex 2 --shardCount 3"
889922
}
890923
924+
# Wasm integration tests in master
925+
- name: Linux_web web_platform_tests_wasm_shard_1 master
926+
bringup: true
927+
recipe: packages/packages
928+
timeout: 60
929+
properties:
930+
target_file: web_platform_tests_wasm.yaml
931+
version_file: flutter_master.version
932+
channel: master
933+
package_sharding: "--shardIndex 0 --shardCount 3"
934+
env_variables: >-
935+
{
936+
"CHANNEL": "master",
937+
"PACKAGE_SHARDING": "--shardIndex 0 --shardCount 3"
938+
}
939+
940+
- name: Linux_web web_platform_tests_wasm_shard_2 master
941+
bringup: true
942+
recipe: packages/packages
943+
timeout: 60
944+
properties:
945+
target_file: web_platform_tests_wasm.yaml
946+
version_file: flutter_master.version
947+
channel: master
948+
package_sharding: "--shardIndex 1 --shardCount 3"
949+
env_variables: >-
950+
{
951+
"CHANNEL": "master",
952+
"PACKAGE_SHARDING": "--shardIndex 1 --shardCount 3"
953+
}
954+
955+
- name: Linux_web web_platform_tests_wasm_shard_3 master
956+
bringup: true
957+
recipe: packages/packages
958+
timeout: 60
959+
properties:
960+
target_file: web_platform_tests_wasm.yaml
961+
version_file: flutter_master.version
962+
channel: master
963+
package_sharding: "--shardIndex 2 --shardCount 3"
964+
env_variables: >-
965+
{
966+
"CHANNEL": "master",
967+
"PACKAGE_SHARDING": "--shardIndex 2 --shardCount 3"
968+
}
969+
970+
# JS integration tests in stable
891971
- name: Linux_web web_platform_tests_shard_1 stable
892972
recipe: packages/packages
893973
timeout: 60

.ci/targets/web_dart_unit_tests.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ tasks:
44
infra_step: true # Note infra steps failing prevents "always" from running.
55
- name: Dart unit tests - web
66
script: .ci/scripts/tool_runner.sh
7-
args: ["dart-test", "--exclude=script/configs/dart_unit_tests_exceptions.yaml", "--platform=chrome"]
7+
args: [
8+
"dart-test",
9+
"--platform=chrome",
10+
"--exclude=script/configs/dart_unit_tests_exceptions.yaml"
11+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tasks:
2+
- name: prepare tool
3+
script: .ci/scripts/prepare_tool.sh
4+
infra_step: true # Note infra steps failing prevents "always" from running.
5+
- name: Dart unit tests - web (wasm)
6+
script: .ci/scripts/tool_runner.sh
7+
args: [
8+
"dart-test",
9+
"--platform=chrome",
10+
"--wasm",
11+
"--exclude=script/configs/dart_unit_tests_exceptions.yaml",
12+
"--exclude=script/configs/dart_unit_tests_wasm_exceptions.yaml"
13+
]

.ci/targets/web_platform_tests.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ tasks:
66
script: .ci/scripts/tool_runner.sh
77
args: ["fetch-deps", "--web", "--supporting-target-platforms-only"]
88
infra_step: true
9-
- name: build examples
10-
script: .ci/scripts/tool_runner.sh
11-
args: ["build-examples", "--web"]
129
- name: drive examples
1310
script: .ci/scripts/tool_runner.sh
14-
args: ["drive-examples", "--web", "--run-chromedriver", "--exclude=script/configs/exclude_integration_web.yaml"]
11+
args: [
12+
"drive-examples",
13+
"--web",
14+
"--run-chromedriver",
15+
"--exclude=script/configs/exclude_integration_web.yaml",
16+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tasks:
2+
- name: prepare tool
3+
script: .ci/scripts/prepare_tool.sh
4+
infra_step: true # Note infra steps failing prevents "always" from running.
5+
- name: download Dart deps
6+
script: .ci/scripts/tool_runner.sh
7+
args: ["fetch-deps", "--web", "--supporting-target-platforms-only"]
8+
infra_step: true
9+
- name: drive examples
10+
script: .ci/scripts/tool_runner.sh
11+
args: [
12+
"drive-examples",
13+
"--web",
14+
"--wasm",
15+
"--run-chromedriver",
16+
"--exclude=script/configs/exclude_integration_web.yaml",
17+
"--exclude=script/configs/exclude_integration_web_wasm.yaml"
18+
]

packages/animations/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
.pub/
3232
/build/
3333

34-
# Web related
35-
lib/generated_plugin_registrant.dart
36-
3734
# Symbolication related
3835
app.*.symbols
3936

packages/animations/example/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@
3030
.pub/
3131
/build/
3232

33-
# Web related
34-
lib/generated_plugin_registrant.dart
35-
3633
# Exceptions to above rules.
3734
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

packages/google_adsense/example/integration_test/experimental_ad_unit_widget_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ Future<void> pumpAdWidget(Widget adUnit, WidgetTester tester) async {
205205

206206
// This extra pump is needed for the platform view to actually render in the DOM.
207207
await tester.pump();
208-
208+
// One more for skwasm.
209+
await tester.pump();
209210
// This extra pump is needed to simulate the async behavior of the adsense JS mock.
210211
await tester.pumpAndSettle();
211212
}

packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/shape_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@ void main() {
232232
visualization.HeatmapLayerOptions()
233233
..data = <gmaps.LatLng>[gmaps.LatLng(0, 0)].toJS;
234234

235-
expect(heatmap.data, hasLength(0));
235+
expect(heatmap.data.array.toDart, hasLength(0));
236236

237237
controller.update(options);
238238

239-
expect(heatmap.data, hasLength(1));
239+
expect(heatmap.data.array.toDart, hasLength(1));
240240
});
241241

242242
group('remove', () {

packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/shapes_test.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void main() {
435435
controller.addHeatmaps(heatmaps);
436436

437437
expect(
438-
controller.heatmaps[const HeatmapId('1')]?.heatmap?.data,
438+
controller.heatmaps[const HeatmapId('1')]!.heatmap!.data.array.toDart,
439439
hasLength(0),
440440
);
441441

@@ -450,7 +450,7 @@ void main() {
450450

451451
expect(controller.heatmaps.length, 1);
452452
expect(
453-
controller.heatmaps[const HeatmapId('1')]?.heatmap?.data,
453+
controller.heatmaps[const HeatmapId('1')]!.heatmap!.data.array.toDart,
454454
hasLength(1),
455455
);
456456
});
@@ -510,7 +510,9 @@ void main() {
510510
controller.heatmaps.values.first.heatmap!;
511511

512512
expect(
513-
heatmap.get('gradient'),
513+
(heatmap.get('gradient')! as JSArray<JSString>)
514+
.toDart
515+
.map((JSString? value) => value!.toDart),
514516
<String>['rgba(250, 186, 218, 0.00)', 'rgba(250, 186, 218, 1.00)'],
515517
);
516518
});

0 commit comments

Comments
 (0)