-
Notifications
You must be signed in to change notification settings - Fork 9.7k
nnbd for integration_test #3158
Conversation
|
|
|
Are we going to use teh |
|
Yes, the |
| environment: | ||
| sdk: ">=2.1.0 <3.0.0" | ||
| sdk: '>=2.10.0-56.0.dev <3.0.0' | ||
| flutter: ">=1.6.7 <2.0.0" |
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.
Should we also update flutter version?
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 think the Dart constraint will take care of that, but we could.
| @visibleForTesting vm.VmService? vmService, | ||
| }) async { | ||
| assert(streams != null); | ||
| assert(streams != null); // ignore: unnecessary_null_comparison |
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 line seems no longer necessary when we have null-safety.
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's still useful when not in sound null safety e.g. importing a non nnbd package
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: does it make sense to merge to asserts?
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.
@nturgut I'm not sure I'm understanding what merge asserts would be in this context...
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's very nit :)
assert(streams !=null && streams. isNotEmpty, 'Non empty stream is required')
| ); | ||
| } | ||
| await _vmService.setVMTimelineFlags(streams); | ||
| vmService ??= await _vmService; |
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 think this should be if (vmService != null) _cachedVmService = vmService, so that traceTimeline will use the provided vmService. And to make it logically more consistent I would change the next line back to await _vmService.setVMTimelineFlags(streams);
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've made the private member a future. I'm also not clear on this, I assumed the param was only for testing.
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.
But this parameter is intended to replace the standard vmService for testing purposes. If I understand it correctly, your version traceTimeline will still call the _cachedVmService obtained by vm_io.vmServiceConnectUri, but what it should call is the vmService provided 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.
Hmm. We should add it as a param there then or move it to the ctor/ensureInitialized It's pretty strange to have a method alter a private member for tests.
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've cleaned this up a bit, let me know what you think.
| String? destinationDirectory, | ||
| }) async { | ||
| assert(testOutputFilename != null); | ||
| assert(testOutputFilename != null); // ignore: unnecessary_null_comparison |
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 line seems no longer necessary when we have null-safety.
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.
Same comment as above - these are still helpful when working in mixed/unsound mode.
|
This is going to have problems because of package:mockito and package:vm_service. |
CareF
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 when the mockVM issue is solved.
|
So we don't really need mockito for this, and the story around using that for NNBD is still being developed so we can just avoid having it block this. Still will be blocked on migration of package:vm_service |
|
|
||
| vm.VmService _vmService; | ||
| vm.VmService? _cachedVmService; | ||
| Future<vm.VmService> get _vmService 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.
Is this change related to nnbd?
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 could be split out into a separate patch. It came up because with nnbd I had to think more carefully about whether this property was nullable or not, and when it'd be set, and came to realize it was getting set by a method when another method might want to use it too.
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 worries, let's keep it here. I think it's enough as long as we add it to the change log/pr description (if something goes wrong it will be easier to see 😅 )
|
|
||
| environment: | ||
| sdk: ">=2.2.2 <3.0.0" | ||
| sdk: '>=2.10.0-56.0.dev <3.0.0' |
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 wonder if this will break the flutter/engine tests, when we want to update e2e version?
https://github.com/flutter/engine/blob/master/e2etests/web/regular_integration_tests/pubspec.yaml#L5 For integration tests
web_ui: https://github.com/flutter/engine/blob/master/lib/web_ui/pubspec.yaml#L5
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.
There's no rush on this, and we won't be able to move forward with it realistically until package:vm_service is migrated, which probably won't happen for at least a couple more weeks.
This constraint should be ok, but by the time we'd publish this it should have a real 2.11 (not .dev) constraint.
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 for the info! :)
nturgut
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.
I added a few comments. I think the best way would be to test a web engine integration test locally with the new version (since the existing tests use the old version we won't know if they fail until we try to upgrade)
|
I'm going to close this, since this package is moving to the flutter repo. |
|
@dnfield this is blocking us from migrating our tests to non-nullable. Is there a separate issue that tracks move to flutter repo ? |
|
It's been moved already. The real blocker for this is that vm_service and then flutter_driver need to be migrated |
TBD: What version/changelog changes to make.