Tests for core VW are broken into several groups:
core.vwtest.json
- contains regression tests mostly centered around running the command line executable, but this also includes script based tests.slow.vwtest.json
- contains a couple of python based regression tests that take a while to run so are split from the core set.unit_test/
contains C++ unit tests
vwtest.json
format tests can be run with run_tests.py
. This driver runs each test in its own directory and in parallel, which is why input_files
and depends_on
must be specified.
By default run_tests.py
will run core.vwtest.json
, unless specified using --test_spec
.
Note: Due to float prediction you almost always want to run run_tests.py
with fuzzy matching:
run_tests.py --fuzzy_compare
This is a JSON file format which describes inputs, commands and expected output of tests. This format can be understood by run_tests.py
which is the core driver. The schema is defined here.
If you are using VSCode you should automatically get JSON completion and checking when editing a *.vwtest.json
file.
- Add a new JSON object to the end of
core.vwtest.json
. - Ensure
id
is unique - Specify what to run, the expected outputs, any required files. If another test produces the file which this test depends on (e.g. a model) then add the
id
todepends_on
.