ooni / probe

OONI Probe network measurement tool for detecting internet censorship
https://ooni.org/install
BSD 3-Clause "New" or "Revised" License
749 stars 142 forks source link

oonirun(v2.go): document and review implementation and tests #2716

Closed bassosimone closed 2 months ago

bassosimone commented 2 months ago

I am about to replace httpx with httpclientx (as implemented in https://github.com/ooni/probe-cli/pull/1560) for the ./internal/oonirunv2 package. Before doing this, I would like to review the implementation and the tests to make sure we have adequate testing and that it's clear what we're doing and why we're doing it. The target files are v2.go and v2_test.go.

This work is part of more comprehensive work described by https://github.com/ooni/probe/issues/2700.

bassosimone commented 2 months ago

It seems we're already covering these cases with tests, while using a real localhost HTTP server:

I do not think the job of the oonirun package would be to test its underlying HTTP library. That sad, because I am changing the underlying library, and for robustness, it won't certainly hurt to add:

Since adding these new test cases would be quick, I think it makes sense since it adds a bit of robustness.