From cacef57b6efa19e8aa4dcb6065e8ac7449a6b9d3 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 16 Feb 2023 18:12:16 +0000 Subject: [PATCH] [flutter_tools] Skip over "Resolving dependencies..." text in integration 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 https://github.com/flutter/flutter/issues/120015 / https://github.com/flutter/flutter/pull/120016. --- .../debug_adapter/flutter_adapter_test.dart | 4 ++-- .../debug_adapter/test_client.dart | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart b/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart index b1da44d3ab..ebcc397b92 100644 --- a/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart +++ b/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart @@ -67,7 +67,7 @@ void main() { 'Application finished.', '', startsWith('Exited'), - ], allowExtras: true); + ]); }); testWithoutContext('logs to client when sendLogsToClient=true', () async { @@ -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. diff --git a/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart b/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart index 8ad1a049ae..f691fb5eff 100644 --- a/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart +++ b/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart @@ -357,12 +357,18 @@ extension DapTestClientExtension on DapTestClient { final List 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; }