-
Notifications
You must be signed in to change notification settings - Fork 361
Add initial framework for integration testing. #4960
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
Add initial framework for integration testing. #4960
Conversation
|
Why Couple options:
|
bkonyi
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.
DBR
packages/devtools_app/integration_test/test_infra/test_app_driver.dart
Outdated
Show resolved
Hide resolved
| Completer<Map<String, dynamic>>(); | ||
| late StreamSubscription<String> sub; | ||
| sub = stdoutController.stream.listen((String line) async { | ||
| final dynamic json = _parseFlutterResponse(line); |
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 type necessary? _parseFlutterResponse has a known, non-dynamic return type.
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.
probably not. All this code was written in pre-null safe Dart land and copied over in this PR. updated.
packages/devtools_app/integration_test/test_infra/test_app_driver.dart
Outdated
Show resolved
Hide resolved
| (id != null && json['id'] == id)) { | ||
| await sub.cancel(); | ||
| response.complete(json); | ||
| } else if (!ignoreAppStopEvent && json['event'] == 'app.stop') { |
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 have constants defined in devtools_shared for these daemon event names?
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.
created enum FlutterDaemonConstants for now with a TODO to consider placing these constants in devtools_shared or in flutter depending on where they would be used.
packages/devtools_app/integration_test/test_infra/test_app_driver.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/integration_test/test_infra/io_utils.dart
Outdated
Show resolved
Hide resolved
Official Flutter guidance recommends code structure: I did try to create a shared test folder, but libraries under test/ and integration_test/ could not import anything outside of their direct folders or lib/. Unit tests and integration tests will have some different "test_infra" so it is okay to have two folders. Once we build out our integration tests more fully, it may make sense to put anything that could be shared between test/ and integration_test into packages/devtools_test so that both test/ and integration_test can share it. This can be done at a later time though when we have a better idea of what will need to be shared. |
|
Work towards #4934 |
This PR adds