-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(webconnectivity*): don't call httpapi directly (#1582)
The #1581 pull request missed that adding a `CallWebConnectivityTestHelper` method to `*engine.Session` means we need to mock such a method in `webconnectivityqa`. I could have mocked the method, but I was not super happy about doing this, because I would rather have wanted to add more QA tests inside of `webconnectivityqa` making sure we're indeed falling back when using test helpers. (We have unit tests testing that, but it would be nice to have integration tests, so we could observe the overall code behavior.) My initial approach for allowing this was to create a `CallWebConnectivityTestHelper` function inside the engine, taking a `model.ExperimentSession` as its fourth argument and then modifying the `CallWebConnectivityTestHelper` method to just invoke the function passing to it the session. However, this approach created import cycles in tests. To avoid import cycles, I moved the `CallWebConnectivityTestHelper` function to `webconnectivityalgo` and modified the mocks inside `webconnectivityqa` to call such a function. This is where I paused and realized that the cleanest solution is actually to just always call the `CallWebConnectivityTestHelper` function in `webconnectivityalgo` and undo part of the changes in #1581 to avoid having a `CallWebConnectivityTestHelper` method inside of `model.ExperimentSession`. And so I also implemented this change. All of this leads us to the current diff, which is part of ooni/probe#2725.
- Loading branch information
1 parent
9a3abfc
commit cc25204
Showing
10 changed files
with
363 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.