fix for flakey analyze test#111895
Conversation
| const String frameworkRevision = '12345678'; | ||
| const String frameworkChannel = 'omega'; | ||
| const String _kDisabledPlatformRequestedMessage = 'currently not supported on your local environment.'; | ||
| const String _kLintingErrorPattern = r"^\s*(?<type>error|info)(\s*[•|-]\s*)(?<desc>[\(\)`@\w\s'-]+)(\s*[•|-]\s*)(?<path>[\\\w'-\/:]+)(\s*[•|-]\s*)(?<lint>[\w'-]+)$"; |
There was a problem hiding this comment.
This pattern is pretty inscrutable :) Is this approach superior to only collecting errors AFTER 'Analyzing flutter_project'?
There was a problem hiding this comment.
Agreed, the pattern is hard to decipher. But I went with this approach because I wasn't sure if the analyze tool could potentially output more lines after the Analyzing... line.
I can make the necessary updates to only check lines after that particular line if you think that is better?
There was a problem hiding this comment.
To help with deciphering it as well, I added named groups within the regex matches so it could potentially make it easier to debug... but adding the named groups also makes the pattern string pretty long
There was a problem hiding this comment.
Agreed, the pattern is hard to decipher. But I went with this approach because I wasn't sure if the analyze tool could potentially output more lines after the Analyzing... line.
"Analyzing flutter_project..." occurs after we're done with the pub get flow: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/analyze_once.dart#L115. It's not perfect, but at least if we regress this I'm pretty sure it will be in our own tool code.
instead looking for the first instance of `Analyzing flutter_project...` to determine when to start capturing error outputs from `flutter analyze`
This PR fixes #111272 by improving how we parse the stdout from
flutter analyzeto find only the relevant linesPre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.