Closed pcrespov closed 2 months ago
Attention: Patch coverage is 60.00000%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 86.9%. Comparing base (
cafbf96
) to head (c3d0da5
). Report is 217 commits behind head on master.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.2% Duplication on New Code
What do these changes do?
This PR removes "httpx client capture" mechanism from
api-server
and moves it as fixtures topytest_simcore.httpx_calls_capture
plugin."httpx client capture " is a technique that wraps
httpx
clients and captures calls (i.e. both requests and responses) from the client to/from the back-end. These "captures" are then dumped into a file and used to producerespx.MockRouter
s that mock the behavior of the back-end during tests. In #5705 we argue that it might be handy to incorporate this mechanism as part of the testing infrastructure instead of being part of the code (as it was now). This way we can use the tests to bothIn addition, any service tests that includes
pytest_simcore.httpx_calls_capture
plugin can now enable, via CLI, a spy on thehttpx.AsyncClient
to produce capture files and then use them to createrespx.MockRouter
that mock the back-end.Related issue/s
How to test
Let's assume we are create a new test suit called
test_it
.Python: Test-Httpx-Spy
inlaunch.template.json
)tests/mock
and usecreate_respx_mock_from_capture
fixtureDev-ops checklist
API_SERVER_DEV_HTTP_CALLS_LOGS_PATH
from master and mark as deprecated for the rest (i.e. add deprecated comment).