protocol / beyond-bitswap

Other
34 stars 9 forks source link

Refactor test cases code. #17

Open adlrocha opened 3 years ago

adlrocha commented 3 years ago

For the sake of development speed and rapid result explorations, there is a lot of redundant code in test cases. This needs to be fixed before it becomes "technical debt".

hannahhoward commented 3 years ago

Hi @adlrocha -- I am going to start working on this shortly

Wanted to run some stuff by you before I do: As I see it, the current test cases are broken up covers a few different concerns:

My thinking is this:

All of these tests share a ton of common steps, that I'd like to refactor to be as deduplicated as possible:

I'd love it if the test cases themselves were quite short -- right now they're hundreds of lines and hard to read to understand what's going on, plus they copy each other a lot.

hannahhoward commented 3 years ago

I will of course update the compositions in the rfc directories as needed in the PR

adlrocha commented 3 years ago

That'd be awesome, @hannahhoward! Everything you suggest SGTM.

Actually, this is something I've been looking to do myself for a while, but never find the time. I keep copy-pasting and patching test cases to evaluate the prototypes but I never invest the time on structuring the code right (so the tests are completely unreadable by themselves). Thanks!