Skip to content
Snippets Groups Projects
user avatar
Maël Madon authored
08bee0d2
History

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?

  1. nix-shell puts you into an environment where batsched, batsim, robin, redis, etc. are available (code in default.nix)
  2. pytest generates combinations of test input (code in conftest.py)
  3. for each combination of inputs: (code in test_runner.py)
  4. pytest generates a robin input file
  5. pytest generates batsim and batsched input files if needed
  6. 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