Skip to content

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Nov 3, 2022

The run_release_test_macos integration test verifies that that the console output of flutter run -d macos --release is expected. This change introduces a RunOutputTask abstraction so that the test's logic can be reused by other platforms like Android and Windows. This new RunOutputTask mirrors other existing device lab tasks like BuildTestTask and PerfTest.

In the future, we will:

  1. Move the existing run_release_test Android integration test to RunOutputTask
  2. Add a new flutter run console output integration test for Windows (see Test that flutter run doesn't introduce new debug spew #111577)
  3. Consider adding flutter run console output tests for other platforms like iOS, Linux, web

Part of #111577

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Nov 3, 2022
Comment on lines -45 to -55
if (
!line.startsWith('Building flutter tool...') &&
!line.startsWith('Running "flutter pub get" in ui...') &&
!line.startsWith('Resolving dependencies...') &&
// Catch engine piped output from unrelated concurrent Flutter apps
!line.contains(RegExp(r'[A-Z]\/flutter \([0-9]+\):')) &&
// Empty lines could be due to the progress spinner breaking up.
line.length > 1
) {
stdout.add(line);
}
Copy link
Member Author

@loic-sharma loic-sharma Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I removed this logic to ignore standard output as it had no effect on the test. The _findNextMatcherInList helper used to verify console output can skip lines.

@loic-sharma loic-sharma marked this pull request as ready for review November 3, 2022 23:55
final String nextLine = list.first;
list.removeAt(0);

if (matcher(nextLine)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may cause out-of-band failures when Xcode is updated, since Xcode loves to add debugging spew, and the macOS build output filtering is very manual:

/// When run in -quiet mode, Xcode should only print from the underlying tasks to stdout.
/// Passing this regexp to trace moves the stdout output to stderr.
///
/// Filter out xcodebuild logging unrelated to macOS builds:
/// xcodebuild[2096:1927385] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
/// note: Using new build system
final RegExp _filteredOutput = RegExp(r'^((?!Requested but did not find extension point with identifier|note\:).)*$');

(as opposed to iOS where the tool output comes from parsing the Xcode build result, not from Xcode build stdout, would really really love macOS to adopt this)

final XCResultIssueDiscarder warningDiscarder = XCResultIssueDiscarder(typeMatcher: XCResultIssueType.warning);
final XCResultIssueDiscarder dartBuildErrorDiscarder = XCResultIssueDiscarder(messageMatcher: RegExp(r'Command PhaseScriptExecution failed with a nonzero exit code'));
final XCResultGenerator xcResultGenerator = XCResultGenerator(resultPath: resultBundle.absolute.path, xcode: globals.xcode!, processUtils: globals.processUtils);
xcResult = await xcResultGenerator.generate(issueDiscarders: <XCResultIssueDiscarder>[warningDiscarder, dartBuildErrorDiscarder]);

Either we can make this more flexible and accept any upcoming line, or we can accept that additional filters may need to be applied as part of updating Xcode.

Copy link
Member Author

@loic-sharma loic-sharma Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a problem as this test ignores unmatched lines. It only checks that the expected lines are in standard output in the correct order. Any Xcode log spew on standard output would be ignored by this test.

Please let me know if I misunderstood your concern!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know if I misunderstood your concern!

Nah I just have Friday brain, your logic LGTM.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 8, 2022
@auto-submit auto-submit bot merged commit 9797d5f into flutter:master Nov 8, 2022
@loic-sharma loic-sharma deleted the macos_run_test branch November 8, 2022 23:10
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 9, 2022
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 9, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
auto-submit bot pushed a commit to flutter/plugins that referenced this pull request Nov 9, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
IVLIVS-III pushed a commit to IVLIVS-III/flutter_plugins_fork that referenced this pull request Nov 11, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
adam-harwood pushed a commit to adam-harwood/flutter_plugins that referenced this pull request Nov 21, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants