-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test file re-organization #81
Comments
Why not simply use |
Oh I assumed asyncio unit tests would just go in
|
I also consider the pytest-asyncio tests "inferior", meaning "not true integration" tests. In my head, a subprocess has essentially the full mechanics of a backgrounded dispatcher in-place. The syncio are then "between" unit and integration on the spectrum of how integrated they are. |
Based on actual experience, I want to go in a different direction, introduce:
The idea is to have Then each test uses the fixture that gives an already-running server. It doesn't start the server for that test. The server runs for the life of all the tests within that module. It still uses postgres and a full server like other tests. This could be asyncio or synchronous, or vary by module. There are many, many, tests that could be ran in this context. Almost all. These tests could not leave jobs running doing sleeps. One way around that is that we could issue a cancel command at the end of the test. Doing this could notably improve the experience of running tests. Having the scope separation based on folder would help to accomplish this IMO. |
Replacing another issue, because this doesn't cut to the true core of what's awkward about writing tests here, and bigger pain points have become clear. |
Please confirm the following
Feature type
Enhancement to Existing Feature
Feature Summary
This proposes a change to organization of files inside of
tests/
folder in this repo.My main reason for doing this is because of painful limitations of
pytest-asyncio
that I wasn't aware when I started. Most of my time writing tests have been debugging the test event loop, as opposed to any meaningful debugging of the service.tests/integration/
-->tests/asyncio/
these are tests usingpytest-asyncio
tests/integration/
--> a new suite that runs the server in a subprocess, which is connected to what I was saying in Adddispatcher/testing/
utilities to help testing #9, and also the method I expect to be used in the DAB apptests/benchmark/
--> patch at Benchmark tests #55, this also runs the server in a subprocess, and hopefully we can merge that with the general fixture. There might be some more complex event exchange through pipes to do this.tests/data/
--> exists, has stuff that tests targettests/unit/
--> exists, tests that don't need postgresPing @Alex-Izquierdo FYI, I have another file moving issue #68
Steps to reproduce
N/A
Current results
No response
Sugested feature result
N/A
Additional information
No response
The text was updated successfully, but these errors were encountered: