You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason for this became more clear while working on #695, where we noticed that not starting the server in the standard way (which includes calling the fractal_server.__main__.set_db function) may lead to inconsistencies.
Note that the script above should also dropdb --if-exists and createdb for the test_fractal_client db
pytest does not run this bash script above. This has to be already running, or pytest will fail.
A session-scoped fixture should call the /alive endpoint (up to a few times, with 1 second of delay), and fail if no attempt succeeds
backend should be on 8765, which is hardcoded both in bash script and pytest configuration
No test should rely on absolute counts of db objects
All tests should have access to a unique identifier, to be used e.g. in new-db-object names (to avoid violating uniqueness constraints). First option: integer timestamp. If more is needed, we can have a function-scoped fixture with a global counter, that grows by one every time it's called. Or something else.
No test should make assumptions on the pre-existing database state. Tests should create all necessary objects, and make assertions only about those.
No test can access the db directly. The current ones that do so (if any) should be refactored. This also means we cannot use current factories.
tcompa
changed the title
Update CI so that it does not start fractal-server from within Python - TBD
Update CI so that it does not start fractal-server from within Python
Sep 25, 2024
The reason for this became more clear while working on #695, where we noticed that not starting the server in the standard way (which includes calling the
fractal_server.__main__.set_db
function) may lead to inconsistencies.First plan would be:
poetry run fractalctl set-db
.dropdb --if-exists
andcreatedb
for thetest_fractal_client
dbThe text was updated successfully, but these errors were encountered: