Previous run_testenv used parsec.core which has been removed, and the Python bindings on libparsec don't expose the new client.
So we should re-implement run_testenv to use the Rust client.
The idea is to also use the testbed component for the populate process:
This allows to easily test multiple scenarios
This is deterministic, so server with in-memory storage can be restarted without the need to recreat the client
Deterministic means we can very simply test how the client behave when a server is rolled back (just sync some modications, then restart the server with memory storage)
In the long term, the testbed system should be supported by the Python server in postgres, so we will have a way to survive server restart
Architecture:
Create a binary command in libparsec that create a client config directory from a given testbed template. The config directory should contain the CRC of the template so that we can be idempotent if the command is re-run on an existing directory.
cargo run -p libparsec --bin client_config_from_testbed -- CoolOrg ./output_config_dir
Re-create server/tests/scripts/run_testenv.py that first use the script from 1. to create the config dir in a temporary location, then start a testbed server (or use the testbed server provided as command argument) and finally return the config dir
Expose run_testenv.py with a ./make.py testenv (and short version ./make.py te) command. This command also starts a sub-shell to have configured the environ variables needed (see what poetry shell does).
The fact the make.py command is running for the whole time the shell is opened means we can provide it PID to the run_testbed_server.py script to tell it to stop when this PID ends (this is what is done for the cargo tests).
Update docs/development/quickstart.md
(bonus) also expose run_testbed_server.py as ./make.py testbed-server/./make.py ts
Previous run_testenv used
parsec.core
which has been removed, and the Python bindings on libparsec don't expose the new client.So we should re-implement
run_testenv
to use the Rust client.The idea is to also use the testbed component for the populate process:
Architecture:
libparsec
that create a client config directory from a given testbed template. The config directory should contain the CRC of the template so that we can be idempotent if the command is re-run on an existing directory.Re-create
server/tests/scripts/run_testenv.py
that first use the script from 1. to create the config dir in a temporary location, then start a testbed server (or use the testbed server provided as command argument) and finally return the config dirExpose
run_testenv.py
with a./make.py testenv
(and short version./make.py te
) command. This command also starts a sub-shell to have configured the environ variables needed (see whatpoetry shell
does). The fact the make.py command is running for the whole time the shell is opened means we can provide it PID to therun_testbed_server.py
script to tell it to stop when this PID ends (this is what is done for the cargo tests).Update
docs/development/quickstart.md
(bonus) also expose
run_testbed_server.py
as./make.py testbed-server
/./make.py ts