From 38cac9105766420d593996b81e18170513d9268c Mon Sep 17 00:00:00 2001 From: Elias Yishak <42216813+eliasyishak@users.noreply.github.com> Date: Mon, 8 May 2023 11:59:28 -0400 Subject: [PATCH] Add `--verbose` flags for flakey tests (#126162) Related to: - https://github.com/flutter/flutter/issues/125512 Adding verbose flags to get printed out on error to help debug the cause of the flakey test --- .../integration.shard/analyze_size_test.dart | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/test/integration.shard/analyze_size_test.dart b/packages/flutter_tools/test/integration.shard/analyze_size_test.dart index 0deac35fab..62bf2d63d6 100644 --- a/packages/flutter_tools/test/integration.shard/analyze_size_test.dart +++ b/packages/flutter_tools/test/integration.shard/analyze_size_test.dart @@ -25,6 +25,7 @@ void main() { flutterBin, 'build', 'apk', + '--verbose', '--analyze-size', '--target-platform=android-arm64', ], workingDirectory: workingDirectory); @@ -61,6 +62,7 @@ void main() { flutterBin, 'build', 'ios', + '--verbose', '--analyze-size', '--code-size-directory=${codeSizeDir.path}', '--no-codesign', @@ -99,6 +101,7 @@ void main() { final ProcessResult configResult = await processManager.run([ flutterBin, 'config', + '--verbose', '--enable-macos-desktop', ], workingDirectory: workingDirectory); @@ -144,6 +147,7 @@ void main() { flutterBin, 'build', 'apk', + '--verbose', '--analyze-size', '--target-platform=android-arm64', '--debug', @@ -159,14 +163,24 @@ void main() { testWithoutContext('--analyze-size is not supported in combination with --split-debug-info', () async { final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); - final ProcessResult result = await processManager.run([ + final List command = [ flutterBin, 'build', 'apk', + '--verbose', '--analyze-size', '--target-platform=android-arm64', '--split-debug-info=infos', - ], workingDirectory: fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world')); + ]; + final String workingDirectory = + fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world'); + final ProcessResult result = + await processManager.run(command, workingDirectory: workingDirectory); + + printOnFailure('workingDirectory: $workingDirectory'); + printOnFailure('command:\n${command.join(" ")}'); + printOnFailure('stdout:\n${result.stdout}'); + printOnFailure('stderr:\n${result.stderr}'); expect(result.stderr.toString(), contains('"--analyze-size" cannot be combined with "--split-debug-info"')); @@ -181,6 +195,7 @@ void main() { flutterBin, 'build', 'apk', + '--verbose', '--analyze-size', '--code-size-directory=${tempDir.path}', '--target-platform=android-arm64',