-
Notifications
You must be signed in to change notification settings - Fork 107
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
Introduce Hypercorn as a local test server on 3.7+ #205
Conversation
6628fcf
to
13999a9
Compare
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.
So I've tested your branch (with mitmproxy
)
So on my local machine the average test suite run takes 27.63s , whereas the latest master
's test run takes more than 90s.
Apart from some questions and a merge conflict, it's a great PR, thank you.
I'm anxious to have these changes in master
.
801bd80
to
baaf4de
Compare
baaf4de
to
27d4f85
Compare
I'm happy with the state of this PR, and happy enough with the fact that we're testing against a different location on 3.6 and elsewhere, as Hypercorn only supports 3.7+. So given an approval already, if it was only me, I'd push on and go ahead and merge, but… Pinging @tomchristie for some of his thoughts as I see it was a possible space of concern for him (#109 (comment)). :-) |
7fc234c
to
125da15
Compare
Happy to take some final reviews, otherwise I think I'll just move forward with this one. :-) |
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.
Having reviewed that again, I've found it perfect! It would allow us to emulate a lot of things to increase coverage
return (b"host", self._host.encode("ascii")) | ||
|
||
|
||
class HypercornServer(Server): # pragma: no cover # Python 3.7+ only |
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 the sake of simplicity I'm nocover
-ing all these classes that are only used either on 3.6 (where hypercorn
isn't available) or on 3.7+ (where hypercorn
is available), but I'm also aware that something like conditional coverage could be used to define rules allowing us to only skip coverage on specific versions. For now, keeping it simple. :-)
5296454
to
d829a8b
Compare
So delighted how fast our test suite is now ✨ Merging, thanks all! |
Re-ignite of #194:
Closes #109
100% of our tests now run locally (and switching to
pproxy
(via #196) made this possible with much less pain :-)).Note: Hypercorn only runs on 3.7, so on 3.6 we keep testing against the
example.org
website, like we do currently. There's a bit of overhead to that, but nothing too blocking I hope, and it's actually nice that we keep some coverage against real-world websites.Follow-ups include: