Skip to content

Commit d5bc08d

Browse files
yjbanovInconnu08
authored andcommitted
Add most of the widget tests; add more web test shards (flutter#42807)
1 parent d87edf0 commit d5bc08d

File tree

3 files changed

+56
-12
lines changed

3 files changed

+56
-12
lines changed

.cirrus.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,36 @@ task:
182182
container:
183183
cpu: 4
184184
memory: 12G
185+
- name: web_tests-linux-shard-3
186+
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
187+
env:
188+
SHARD: web_tests
189+
WEB_SHARD: 3
190+
test_script:
191+
- dart --enable-asserts ./dev/bots/test.dart
192+
container:
193+
cpu: 4
194+
memory: 12G
195+
- name: web_tests-linux-shard-4
196+
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
197+
env:
198+
SHARD: web_tests
199+
WEB_SHARD: 4
200+
test_script:
201+
- dart --enable-asserts ./dev/bots/test.dart
202+
container:
203+
cpu: 4
204+
memory: 12G
205+
- name: web_tests-linux-shard-5
206+
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
207+
env:
208+
SHARD: web_tests
209+
WEB_SHARD: 5
210+
test_script:
211+
- dart --enable-asserts ./dev/bots/test.dart
212+
container:
213+
cpu: 4
214+
memory: 12G
185215
- name: build_tests-linux
186216
env:
187217
SHARD: build_tests

dev/bots/test.dart

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -434,23 +434,35 @@ Future<void> _runTests() async {
434434
print('${bold}DONE: All tests successful.$reset');
435435
}
436436

437+
// TODO(yjbanov): we're getting rid of these blacklists as part of https://github.com/flutter/flutter/projects/60
438+
const List<String> kWebTestDirectoryBlacklist = <String>[
439+
'test/cupertino',
440+
'test/examples',
441+
'test/material',
442+
];
443+
const List<String> kWebTestFileBlacklist = <String>[
444+
'test/widgets/heroes_test.dart',
445+
'test/widgets/text_test.dart',
446+
'test/widgets/selectable_text_test.dart',
447+
'test/widgets/color_filter_test.dart',
448+
'test/widgets/editable_text_cursor_test.dart',
449+
'test/widgets/shadow_test.dart',
450+
'test/widgets/raw_keyboard_listener_test.dart',
451+
'test/widgets/editable_text_test.dart',
452+
'test/widgets/widget_inspector_test.dart',
453+
'test/widgets/draggable_test.dart',
454+
'test/widgets/shortcuts_test.dart',
455+
];
456+
437457
Future<void> _runWebTests() async {
438458
final Directory flutterPackageDir = Directory(path.join(flutterRoot, 'packages', 'flutter'));
439459
final Directory testDir = Directory(path.join(flutterPackageDir.path, 'test'));
440460

441-
// TODO(yjbanov): we're getting rid of this blacklist as part of https://github.com/flutter/flutter/projects/60
442-
const List<String> kBlacklist = <String>[
443-
'test/cupertino',
444-
'test/examples',
445-
'test/material',
446-
'test/widgets',
447-
];
448-
449461
final List<String> directories = testDir
450462
.listSync()
451463
.whereType<Directory>()
452464
.map<String>((Directory dir) => path.relative(dir.path, from: flutterPackageDir.path))
453-
.where((String relativePath) => !kBlacklist.contains(relativePath))
465+
.where((String relativePath) => !kWebTestDirectoryBlacklist.contains(relativePath))
454466
.toList();
455467

456468
await _runFlutterWebTest(flutterPackageDir.path, tests: directories);
@@ -687,7 +699,7 @@ class EvalResult {
687699
///
688700
/// WARNING: if you change this number, also change .cirrus.yml
689701
/// and make sure it runs _all_ shards.
690-
const int _kWebShardCount = 3;
702+
const int _kWebShardCount = 6;
691703

692704
Future<void> _runFlutterWebTest(String workingDirectory, {
693705
List<String> tests,
@@ -699,7 +711,8 @@ Future<void> _runFlutterWebTest(String workingDirectory, {
699711
testDir.listSync(recursive: true)
700712
.whereType<File>()
701713
.where((File file) => file.path.endsWith('_test.dart'))
702-
.map((File file) => path.relative(file.path, from: workingDirectory))
714+
.map<String>((File file) => path.relative(file.path, from: workingDirectory))
715+
.where((String filePath) => !kWebTestFileBlacklist.contains(filePath)),
703716
);
704717
}
705718

packages/flutter/test/widgets/html_element_view_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ void main() {
196196
// is not yet in the tree.
197197
await tester.pump();
198198

199-
final SemanticsNode semantics = tester.getSemantics(find.byType(HtmlElementView));
199+
// The platform view ID is set on the child of the HtmlElementView render object.
200+
final SemanticsNode semantics = tester.getSemantics(find.byType(PlatformViewSurface));
200201

201202
expect(semantics.platformViewId, currentViewId + 1);
202203
expect(semantics.rect, const Rect.fromLTWH(0, 0, 200, 100));

0 commit comments

Comments
 (0)