From dcc1f0603961c72e5c6db7bbe3cd7d4461e8ebff Mon Sep 17 00:00:00 2001 From: flutteractionsbot <154381524+flutteractionsbot@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:07:56 -0700 Subject: [PATCH] [CP-stable]Change flutter_build_with_compilation_error_test to check stdout or stderr (#153116) ### Issue Link: https://github.com/flutter/flutter/issues/151553 ### Changelog Description: Make a flutter_tools test pass on Xcode 16 beta. ### Impact Description: When we update our CI to Xcode 16 after it releases (likely in September), all tests should pass. ### Workaround: Turning off the test. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: - Install Xcode 15 and run the test (this is happening in CI now). - Install Xcode 16 latest beta and run the test. Part of https://github.com/flutter/flutter/issues/148959 --- ...lutter_build_with_compilation_error_test.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/flutter_tools/test/integration.shard/flutter_build_with_compilation_error_test.dart b/packages/flutter_tools/test/integration.shard/flutter_build_with_compilation_error_test.dart index 36d15e90859..07de04c3c1c 100644 --- a/packages/flutter_tools/test/integration.shard/flutter_build_with_compilation_error_test.dart +++ b/packages/flutter_tools/test/integration.shard/flutter_build_with_compilation_error_test.dart @@ -63,14 +63,16 @@ int x = 'String'; '--no-codesign', ], workingDirectory: projectRoot.path); - expect( - result, - const ProcessResultMatcher( - exitCode: 1, - stderrPattern: "A value of type 'String' can't be assigned to a variable of type 'int'.", - ), - ); + const String errorMessage = "A value of type 'String' can't be assigned to a variable of type 'int'."; + + // Xcode 16 moved the xcodebuild error details from stderr to stdout. + // Check that it's contained in one or the other. + final bool matchStdout = result.stdout.toString().contains(errorMessage); + final bool matchStderr = result.stderr.toString().contains(errorMessage); + + expect(matchStdout || matchStderr, isTrue); expect(result.stderr, isNot(contains("Warning: The 'dart2js' entrypoint script is deprecated"))); + expect(result.stdout, isNot(contains("Warning: The 'dart2js' entrypoint script is deprecated"))); }); } }