Batmen tests
Extra dependencies
Some tests use a tool from the external library batmen-tools
developped separately. To update it to the latest version:
cd test
curl -O https://gitlab.irit.fr/sepia-pub/mael/batmen-tools/-/raw/main/distance_batsim_output.py
Running tests
nix-shell ../default.nix -A test --command 'pytest'
# or just pytest, but you must prepare your env...
Optionally, use Batsim's binary cache to avoid recompiling many things (e.g., SimGrid).
nix-env -iA cachix -f https://cachix.org/api/v1/install # installs cachix
cachix use batsim # add Batsim's cachix storage as a Nix remote cache
How does it work?
- nix-shell puts you into an environment where batsched, batsim, robin, redis, etc. are available (code in default.nix)
- pytest generates combinations of test input (code in conftest.py)
- for each combination of inputs: (code in test_runner.py)
- pytest generates a robin input file
- pytest generates batsim and batsched input files if needed
- pytest executes robin or robintest on the generated file
Running a specific test
You can manually rerun a test with robin:
robin test-instances/FAILING-TEST.yaml
You can also run batsim and batsched in different terminals:
# feel free to hack these files — e.g., prepend commands with gdb, valgrind...
./test-out/FAILING-TEST/cmd/batsim.bash
./test-out/FAILING-TEST/cmd/sched.bash