-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix the firebase scenario app run and assert that it does good things #27295
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
This PR does in fact have tests. |
| new MethodChannel(getFlutterEngine().getDartExecutor(), "driver", JSONMethodCodec.INSTANCE); | ||
| Map<String, Object> test = new HashMap<>(2); | ||
| test.put("name", launchIntent.getStringExtra("scenario")); | ||
| test.put("name", "animated_color_square"); |
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.
is this right? Seems like this is the mechanism to control which test to run no?
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.
+1
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.
The launch intent we get here is an integer, not a string. The method channel used expects a string with the name of the test.
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.
launchIntent.getStringExtra("scenario") should equal to the values defined in
Line 36 in 2b11d09
| intent.putExtra("scenario", "platform_view"); |
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.
We should use a different extra name though - because firebase testlab sets this as an integer.
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.
is "scenario" a reserved word by Firebase?
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.
For gameloops yes.
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.
oh lol. I was wondering why we never caught this. Renaming sg. We need to do it everywhere in this project to keep things working.
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.
Done - renamed the intent extra to scenario_name for these and use it if it's available.
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.
Awesome! thanks
| * @param viewportMetrics The metrics to send to the Dart application. | ||
| */ | ||
| public void setViewportMetrics(@NonNull ViewportMetrics viewportMetrics) { | ||
| if (!viewportMetrics.validate()) { |
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.
what's the edge case here? Leave a code comment for the next person?
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.
also, should it throw?
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.
We call this method when we get DPR updates, which can happen before we get width/height. The embedding ends up calling this with just the DPR sometimes.
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.
Added a comment
ci/firebase_testlab.sh
Outdated
| exit 1 | ||
| fi | ||
|
|
||
| result_size=$(gsutil du gs://flutter_firebase_testlab/engine_scenario_test/deadbeef/dnfield1/\*/game_loop_results/results_scenario_0.json | cut -d " " -f1) |
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.
did you want to leave these personal paths in here?
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, no.
| --results-dir="engine_scenario_test/$GIT_REVISION/$BUILD_ID" \ | ||
| --device model=flame,version=29 | ||
|
|
||
| errors=$(gsutil cat gs://flutter_firebase_testlab/engine_scenario_test/$GIT_REVISION/$BUILD_ID/\*/logcat | grep "[FE]/flutter" | true) |
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.
what does FE stand for? is it Flutter engine?
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.
Look for fatal or error warnings, i.e. F/flutter or E/flutter
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 nice! I learned something new about grep
| if (data != null) { | ||
| print('$name = ${utf8.decode(data.buffer.asUint8List())}'); | ||
| } else { | ||
| print(name); |
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.
nit: print('$name = null');
blasten
left a 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.
LGTM
| new MethodChannel(getFlutterEngine().getDartExecutor(), "driver", JSONMethodCodec.INSTANCE); | ||
| Map<String, Object> test = new HashMap<>(2); | ||
| test.put("name", launchIntent.getStringExtra("scenario")); | ||
| test.put("name", "animated_color_square"); |
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.
oh lol. I was wondering why we never caught this. Renaming sg. We need to do it everywhere in this project to keep things working.
xster
left a 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.
Thanks
Currently, the scenario app is failing and we're not bothering to check whether it passed or failed.
GameLoop tests pass as long as the application doesn't completely crash.
Currently, the Dart program fails because it tries to print the property of a null object. I'm also fixing up some things that would emit errors and make the log checking harder.
fixes flutter/flutter#86191