Rebaselining tests#

It is often necessary to update the baseline values for a test when the outputs change due to modifications in the code. The canary rebaseline feature allows you to reset the baseline (accepted) values for one or more tests.

Note

For a test to be rebaselined, it must define the baseline instructions. See canary.directives.baseline().

By default, canary rebaseline will reset baseline values for all diffed tests. Eg, running

canary -C TestResults rebaseline

Note

canary rebaseline should be run inside of a workspace view by either navigating to it or by canary -C PATH.

canary rebaseline accepts the same filtering arguments as canary run. Eg, to rebaseline failed tests one can

canary -C TestResults rebaseline -k fail

To rebaseline a single test, change to that tests execution directory and run:

cd $(canary location ID)
canary rebaseline .

where ID is the test’s ID.