-
Notifications
You must be signed in to change notification settings - Fork 28.8k
[flutter_tools] Use process matcher for multidex test #127996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flutter_tools] Use process matcher for multidex test #127996
Conversation
final String stdout = result.stdout as String; | ||
final String stderr = result.stderr as String; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do any null checks on these? Or can we assume that it will always return an empty string when empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this will always be either List<int>
(if you chose not to encode it) or String
https://github.com/dart-lang/sdk/blob/main/sdk/lib/io/process.dart#L525
final String stdout = result.stdout as String; | ||
final String stderr = result.stderr as String; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do any null checks on these? Or can we assume that it will always return an empty string when empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, see the other comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sgtm, sorry for the double comment
expect(result, const ProcessResultMatcher(exitCode: 1)); | ||
expect(result.stderr.toString(), contains('Cannot fit requested classes in a single dex file')); | ||
expect(result.stderr.toString(), contains('The number of method references in a .dex file cannot exceed 64K.')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we refactor this to use the matcher's stdout
and stderr
matchers?
expect(result, const ProcessResultMatcher(exitCode: 1)); | |
expect(result.stderr.toString(), contains('Cannot fit requested classes in a single dex file')); | |
expect(result.stderr.toString(), contains('The number of method references in a .dex file cannot exceed 64K.')); | |
expect( | |
result, | |
const ProcessResultMatcher( | |
exitCode: 1, | |
stderrPattern: 'Cannot fit requested classes in a single dex file', | |
stdoutPattern: | |
'The number of method references in a .dex file cannot exceed 64K.')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are both on stderr though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I was going too fast, makes sense though. LGTM on everything else then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly thought about some kind of API that would allow either a pattern OR Iterable<Pattern>
for stdout matchers, but then thought better of it given how confusing the process.stdout
API is (it's typed dynamic
but is one of String
or List<int>
Roll Flutter from 3db9504 to 0b74153 (108 revisions) flutter/flutter@3db9504...0b74153 2023-06-03 [email protected] Roll Flutter Engine from 54293721816a to c838a1b05924 (2 revisions) (flutter/flutter#128161) 2023-06-03 [email protected] Roll Flutter Engine from 8769e9ce3a90 to 54293721816a (8 revisions) (flutter/flutter#128158) 2023-06-03 [email protected] Prefix for dart:ui multiview change (flutter/flutter#128152) 2023-06-02 [email protected] Roll dds dependency to 2.8.3 for expression evaluation upcoming fixes. (flutter/flutter#128124) 2023-06-02 [email protected] Roll Flutter Engine from f3f6a020595d to 8769e9ce3a90 (3 revisions) (flutter/flutter#128149) 2023-06-02 [email protected] Roll Flutter Engine from b4250acbf3ca to f3f6a020595d (3 revisions) (flutter/flutter#128147) 2023-06-02 [email protected] Reland "Remove obsolete drawShadow bounds workaround (#127052)" (flutter/flutter#127231) 2023-06-02 [email protected] Roll Flutter Engine from c6e9383f2143 to b4250acbf3ca (8 revisions) (flutter/flutter#128142) 2023-06-02 [email protected] Pre-migration for dart:ui multi view changes (flutter/flutter#128092) 2023-06-02 [email protected] Remove LiveTestRenderView (flutter/flutter#127882) 2023-06-02 [email protected] Roll Flutter Engine from 02d6fbb68b69 to c6e9383f2143 (15 revisions) (flutter/flutter#128119) 2023-06-02 [email protected] Tiny remove unnecessary method in text_selection.dart (flutter/flutter#127480) 2023-06-02 [email protected] Workaround for Dart VM timeout (flutter/flutter#127875) 2023-06-02 [email protected] Make --flutter-repo analyze whole repo (flutter/flutter#127990) 2023-06-02 [email protected] Roll Packages from f0513ae to 75085ed (3 revisions) (flutter/flutter#128121) 2023-06-02 [email protected] [Refactor] fix quote style in template (flutter/flutter#127762) 2023-06-02 [email protected] Roll Flutter Engine from 3a453f2ccb77 to 02d6fbb68b69 (14 revisions) (flutter/flutter#128089) 2023-06-02 [email protected] Fix typos in labels (flutter/flutter#128093) 2023-06-02 [email protected] Revert "Fix issue where DevTools would not be immediately available when using --start-paused" (flutter/flutter#128117) 2023-06-02 [email protected] Sync Lints (flutter/flutter#127976) 2023-06-02 [email protected] Updated TabBar and ToggleButtons examples (flutter/flutter#128088) 2023-06-02 [email protected] Text should still be centered when search bar height is less than 48 (flutter/flutter#128068) 2023-06-02 [email protected] Roll pub packages (flutter/flutter#128053) 2023-06-01 [email protected] Add `FilterChip.elevated`, `ChoiceChip.elevated`, & `ActionChip.elevated` variants (flutter/flutter#128049) 2023-06-01 [email protected] Updated custom ListTile examples (flutter/flutter#128071) 2023-06-01 [email protected] Fix issue where DevTools would not be immediately available when using --start-paused (flutter/flutter#126698) 2023-06-01 [email protected] Add error message when sliver overlap absorber is missing (flutter/flutter#128075) 2023-06-01 [email protected] Updated Menu examples (flutter/flutter#128080) 2023-06-01 [email protected] Add retry flag to flutter_test (flutter/flutter#125851) 2023-06-01 [email protected] [flutter_tools] Use process matcher for multidex test (flutter/flutter#127996) 2023-06-01 [email protected] Updated InputDecoratorExamples for M3 (flutter/flutter#128065) 2023-06-01 [email protected] Roll Flutter Engine from 7c0a639efd0a to 3a453f2ccb77 (1 revision) (flutter/flutter#128064) 2023-06-01 [email protected] migrate the package_autoroller from querying by label to title (flutter/flutter#128066) 2023-06-01 [email protected] Revised Floating Action Button examples (flutter/flutter#128058) 2023-06-01 [email protected] Roll Flutter Engine from fdd39c421fb9 to 7c0a639efd0a (2 revisions) (flutter/flutter#128056) 2023-06-01 [email protected] Roll Flutter Engine from c8e1a8d6fb57 to fdd39c421fb9 (1 revision) (flutter/flutter#128050) 2023-06-01 [email protected] [labeler] Remove use of any (flutter/flutter#128011) 2023-06-01 [email protected] [framework] remove reference to closed issue. (flutter/flutter#128007) 2023-06-01 [email protected] Roll Packages from 95bb793 to f0513ae (3 revisions) (flutter/flutter#128045) 2023-06-01 [email protected] Add fallback font to IconData class (flutter/flutter#127269) 2023-06-01 [email protected] [web] Assert route names start with / if using PathUrlStrategy (flutter/flutter#127986) 2023-06-01 [email protected] [tool] In `flutter doctor -v`, warn when Android Studio version could not be detected. (flutter/flutter#126395) 2023-06-01 [email protected] Roll Flutter Engine from 8339c71a963c to c8e1a8d6fb57 (1 revision) (flutter/flutter#128035) 2023-06-01 [email protected] Roll Flutter Engine from bc81133892a6 to 8339c71a963c (1 revision) (flutter/flutter#128034) 2023-06-01 [email protected] Roll Flutter Engine from e235f47164fa to bc81133892a6 (1 revision) (flutter/flutter#128026) 2023-06-01 [email protected] Fixes in Cupertino translations (flutter/flutter#127872) ...
Part of #127135
Part of #125115