这是indexloc提供的服务,不要输入任何密码
Skip to content

[flutter_tools] remove mocks from devFS test #82471

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

Merged

Conversation

jonahwilliams
Copy link
Contributor

Remove mocks from the devFS test by using the real osutils and adding the capability to match network request bodies.
Replaces mock usage with fake otherwise.

Work towards #71511

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 13, 2021
@google-cla google-cla bot added the cla: yes label May 13, 2021
@jonahwilliams jonahwilliams requested a review from zanderso May 13, 2021 19:49
@@ -202,7 +201,8 @@ void main() {
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put)
// This is the value of `<int>[1, 2, 3, 4, 5]` run through `osUtils.gzipLevel1Stream`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is better since we're using the real OS utils.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh oh ... is this different on different platforms?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked over the Dart SDK sources quickly, but didn't see anything platform specific in them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this to encode the expected value on the fly to work around it. But there is either some machine specific or host specific dependencies.

From linux-x64 build bot:

[31, 139, 8, 0, 0, 0, 0, 0, 4, 3, 99, 100, 98, 102, 97, 5, 0, 244, 153, 11, 71, 5, 0, 0, 0]

from macos-x64 build bot:

[31, 139, 8, 0, 0, 0, 0, 0, 4, 19, 99, 100, 98, 102, 97, 5, 0, 244, 153, 11, 71, 5, 0, 0, 0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants