Scille / parsec-cloud

Open source Dropbox-like file sharing with full client encryption !
https://parsec.cloud
Other
268 stars 40 forks source link

[:boxing_glove: :1st_place_medal: Final oxidation] Re-implement run_testenv script #4672

Open touilleMan opened 1 year ago

touilleMan commented 1 year ago

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:

  1. 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
  1. 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

  2. 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).

  3. Update docs/development/quickstart.md

  4. (bonus) also expose run_testbed_server.py as ./make.py testbed-server/./make.py ts

TimeEngineer commented 9 months ago

Can be closed ?