cleanup: merge legacy errorsx in netxlite and hide classifiers (#655)

This diff implements the first two cleanups defined at https://github.com/ooni/probe/issues/1956:

> - [ ] observe that `netxlite` and `netx` differ in error wrapping only in the way in which we set `ErrWrapper.Operation`. Observe that the code using `netxlite` does not care about such a field. Therefore, we can modify `netxlite` to set such a field using the code of `netx` and we can remove `netx` specific code for errors (which currently lives inside of the `./internal/engine/legacy/errorsx` package
>
> - [ ] after we've done the previous cleanup, we can make all the classifiers code private, since there's no code outside `netxlite` that needs them

A subsequent diff will address the remaining cleanup.

While there, notice that there are failing, unrelated obfs4 tests, so disable them in short mode. (I am confident these tests are unrelated because they fail for me when running test locally from the `master` branch.)
This commit is contained in:
Simone Basso
2022-01-07 17:31:21 +01:00
committed by GitHub
parent 99ec7ffca9
commit 1c057d322d
34 changed files with 258 additions and 1093 deletions
+8 -2
View File
@@ -13,8 +13,10 @@ import (
)
func TestOBFS4DialerWorks(t *testing.T) {
// This test is 0.3 seconds in my machine, so it's ~fine
// to run it even when we're in short mode
if testing.Short() {
// Was failing in https://github.com/ooni/probe-cli/pull/655
t.Skip("skip test in short mode")
}
o4d := DefaultTestingOBFS4Bridge()
conn, err := o4d.DialContext(context.Background())
if err != nil {
@@ -103,6 +105,10 @@ func (c *obfs4connwrapper) Close() error {
}
func TestOBFS4DialerWorksWithContextExpiration(t *testing.T) {
if testing.Short() {
// Was failing in https://github.com/ooni/probe-cli/pull/655
t.Skip("skip test in short mode")
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
called := &atomicx.Int64{}