Skip to content

Commit

Permalink
[flutter_tools] Skip over "Resolving dependencies..." text in integra…
Browse files Browse the repository at this point in the history
…tion tests (#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/flutter#120015 / flutter/flutter#120016.
  • Loading branch information
DanTup authored Feb 16, 2023
1 parent df98689 commit cacef57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void main() {
'Application finished.',
'',
startsWith('Exited'),
], allowExtras: true);
]);
});

testWithoutContext('logs to client when sendLogsToClient=true', () async {
Expand Down Expand Up @@ -131,7 +131,7 @@ void main() {
'Application finished.',
'',
startsWith('Exited'),
], allowExtras: true);
]);

// If we're running with an out-of-process debug adapter, ensure that its
// own process shuts down after we terminated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,18 @@ extension DapTestClientExtension on DapTestClient {

final List<OutputEventBody> output = await outputEventsFuture;

// TODO(dantup): Integration tests currently trigger "flutter pub get" at
// the start due to some timestamp manipulation writing the pubspec.
// It may be possible to remove this if
// https://github.com/flutter/flutter/pull/91300 lands.
// Integration tests may trigger "flutter pub get" at the start based of
// `pubspec/yaml` and `.dart_tool/package_config.json`.
// See
// https://github.com/flutter/flutter/pull/91300
// https://github.com/flutter/flutter/issues/120015
return skipInitialPubGetOutput
? output.skipWhile((OutputEventBody output) => output.output.startsWith('Running "flutter pub get"')).toList()
? output
.skipWhile((OutputEventBody output) =>
output.output.startsWith('Running "flutter pub get"') ||
output.output.startsWith('Resolving dependencies') ||
output.output.startsWith('Got dependencies'))
.toList()
: output;
}

Expand Down

0 comments on commit cacef57

Please sign in to comment.