hyper
hyper copied to clipboard
Clean up Client and Server integration tests
Both the client and server tests (tests/client.rs and tests/server.rs) started with small abstractions, but they weren't flexible enough, and so as more complicated cases were needed, the tests just got more and more complicated, with a lot of repetition. It'd be huge to find a way to refactor them.
I will take this issue and work on it!
Would you have something in mind as well? @seanmonstar
@seanmonstar is it still open? :)
Yes, this is still open because the integration tests feel very messy, and there's a lot of repeated code. I'm sorry I haven't been able to provide much guidance on how to improve them, if I thought about it a lot, I'd probably fix them myself :)
Well, if it's very messy so we could improve it a little each PR, for example let's remove (as many as possible) repeated code first. If you feel ok with this approach I could try it :) (hopefully it's easy as labelled :D).
I'd like to try and tackle this one if it hasn't been done yet! The tests seem quite long though...
Yea, it's not done yet. Admittedly, this is between an easy and medium task. For example, in tests/client.rs there is a few submodules testing different implementations or parts of the client API, and most are using a lot of the same code copied and pasted but then ever slightly modified. So it makes the files long, and more tedious to adjust. It'd be best if we could break it up into multiple tests/client_blah.rs files, separated by main "concerns", and with the various duplicate code cleaned up into smaller helpers.
Ok great, I'll slowly work on this then.
Hi @seanmonstar Could you please take a look at https://github.com/hyperium/hyper/pull/3072
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.
Thanks