Skip to content

Commit cacef57

Browse files
authored
[flutter_tools] Skip over "Resolving dependencies..." text in integration tests (flutter#120077)
Sometimes when the integration tests run Flutter apps they get this output (perhaps based on timing of file modification times). Some of the tests want to verify strict output but not fail just based on these lines before the app starts. See flutter#120015 / flutter#120016.
1 parent df98689 commit cacef57

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void main() {
6767
'Application finished.',
6868
'',
6969
startsWith('Exited'),
70-
], allowExtras: true);
70+
]);
7171
});
7272

7373
testWithoutContext('logs to client when sendLogsToClient=true', () async {
@@ -131,7 +131,7 @@ void main() {
131131
'Application finished.',
132132
'',
133133
startsWith('Exited'),
134-
], allowExtras: true);
134+
]);
135135

136136
// If we're running with an out-of-process debug adapter, ensure that its
137137
// own process shuts down after we terminated.

packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,18 @@ extension DapTestClientExtension on DapTestClient {
357357

358358
final List<OutputEventBody> output = await outputEventsFuture;
359359

360-
// TODO(dantup): Integration tests currently trigger "flutter pub get" at
361-
// the start due to some timestamp manipulation writing the pubspec.
362-
// It may be possible to remove this if
363-
// https://github.com/flutter/flutter/pull/91300 lands.
360+
// Integration tests may trigger "flutter pub get" at the start based of
361+
// `pubspec/yaml` and `.dart_tool/package_config.json`.
362+
// See
363+
// https://github.com/flutter/flutter/pull/91300
364+
// https://github.com/flutter/flutter/issues/120015
364365
return skipInitialPubGetOutput
365-
? output.skipWhile((OutputEventBody output) => output.output.startsWith('Running "flutter pub get"')).toList()
366+
? output
367+
.skipWhile((OutputEventBody output) =>
368+
output.output.startsWith('Running "flutter pub get"') ||
369+
output.output.startsWith('Resolving dependencies') ||
370+
output.output.startsWith('Got dependencies'))
371+
.toList()
366372
: output;
367373
}
368374

0 commit comments

Comments
 (0)