-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Migrate analyze_size to null safety #81002
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
Conversation
if (decodedAotSnapshot == null) { | ||
throwToolExit('AOT snapshot is invalid for analysis'); | ||
} |
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 can't imagine this ever being null (more likely a FormatException
) but just in case. I added a test for it.
} | ||
final Map<String, Object?> processedAotSnapshotJson = treemapFromJson(decodedAotSnapshot); | ||
final _SymbolNode? aotSnapshotJsonRoot = _parseAotSnapshot(processedAotSnapshotJson); | ||
if (aotSnapshotJsonRoot != null) { |
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 mostly ignored null nodes or missing keys instead of throwing, I can change it if we want to be more aggressive with the expected formatting instead of silently handling it, if preferred.
import 'test_utils.dart'; | ||
|
||
const String apkDebugMessage = 'A summary of your APK analysis can be found at: '; | ||
const String iosDebugMessage = 'A summary of your iOS bundle analysis can be found at: '; | ||
const String runDevToolsMessage = 'flutter pub global activate devtools; flutter pub global run devtools '; | ||
|
||
void main() { | ||
testWithoutContext('--analyze-size flag produces expected output on hello_world for Android', () async { | ||
testUsingContext('--analyze-size flag produces expected output on hello_world for Android', () async { |
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.
This didn't even pass locally on master, it needs the context shutdown hook.
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.
This is definitely running on CI right? How would it be passing otherwise
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.
It passes on CI but not locally because the code that uses the context is in getFlutterRoot
, which gets bypassed on LUCI because FLUTTER_ROOT
is set. I explained it a bit more in #79975.
Really I need to fix the underlying problem, but I've prioritized patching up these integration tests with testUsingContext
so I can at least run them locally.
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.
LGTM
This pull request is not suitable for automatic merging in its current state.
|
b77b45b
to
e95617d
Compare
Part of #71511