Skip to content
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

refactor(test):#1675 use fns for creating test server #3072

Merged
merged 3 commits into from
Dec 5, 2022

Conversation

alexs-sh
Copy link
Contributor

@alexs-sh alexs-sh commented Dec 4, 2022

This is a part of #1675 issue. It
slightly reduces the number of duplicated code by using one common function for
init a logger and creating a test server.

This is a part of hyperium#1675 issue. It slightly reduces the number of
duplicated code by using one common function for init a logger and
creating a Tokio server.
This is a part of hyperium#1675 issue. It slightly reduces the number of
duplicated code by using one common function for init a logger and
creating a std server.
@alexs-sh
Copy link
Contributor Author

alexs-sh commented Dec 4, 2022

This PR doesn't provide any significant changes but allows to make one step in decreasing code duplication. If it's the wrong way, please, just reject the PR. If it brings something useful, then I can continue with it.

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

This is exactly what I meant in the original issue, that some boilerplate had been copied around way too much. Thank you so much for tackling this <3

@alexs-sh
Copy link
Contributor Author

alexs-sh commented Dec 5, 2022

Happy to help :)

There is yet another possibility to reduce boilerplate code. For example, tests often use the pattern "create server and spawn processing" + "create client and do something". Processing and doing something differ from test to test, but creating a server and connecting a client is often very similar. So I can try to generalize them and show the results.

@seanmonstar seanmonstar merged commit fdffc1d into hyperium:master Dec 5, 2022
@alexs-sh alexs-sh deleted the issue-1675-use-setup branch December 11, 2022 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants