Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[integration_test] Fix tests from changes to flutter test machine output #3480

Merged
merged 2 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/integration_test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.2+2

* Fix tests from changes to `flutter test` machine output.

## 1.0.2+1

* Update vm_service constraint
Expand Down
2 changes: 1 addition & 1 deletion packages/integration_test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: integration_test
description: Runs tests that use the flutter_test API as integration tests.
version: 1.0.2+1
version: 1.0.2+2
homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test

environment:
Expand Down
7 changes: 6 additions & 1 deletion packages/integration_test/test/binding_fail_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,18 @@ Future<Map<String, dynamic>> _runTest(String scriptPath) async {
final String testResults = (await process.stdout
.transform(utf8.decoder)
.expand((String text) => text.split('\n'))
.map((String line) {
.map<dynamic>((String line) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure you need this <dynamic> here? But if no linter complains, let's gooo!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think since this is copied from the SDK repo, where type annotations are necessary

try {
return jsonDecode(line);
} on FormatException {
// Only interested in test events which are JSON.
}
})
.expand<Map<String, dynamic>>((dynamic json) {
return json is List<dynamic>
? json.cast()
: <Map<String, dynamic>>[json as Map<String, dynamic>];
})
.where((dynamic testEvent) =>
testEvent != null && testEvent['type'] == 'print')
.map((dynamic printEvent) => printEvent['message'] as String)
Expand Down