Some selectors, such as
syntax, allow saving and loading presets from a file. This is a
good way to reuse a selection, either at a later date or by sharing with others. Look for a
‘preset’ section in
mach <selector> --help to determine whether the selector supports this
To save a preset, run:
$ mach try <selector> --save <name> <args>
For example, to save a preset that selects all Windows mochitests:
$ mach try fuzzy --save all-windows-mochitests --query "'win 'mochitest" preset saved, run with: --preset=all-windows-mochitests
Then run that saved preset like this:
$ mach try --preset all-windows-mochitests
To see a list of all available presets run:
$ mach try --list-presets
Editing and Sharing Presets¶
Presets can be defined in one of two places, in your home directory or in a file checked into mozilla-central.
These are defined in your
Presets defined here are your own personal collection of presets. You can modify them by running:
$ ./mach try --edit-presets
Presets are simple key/value objects, with the name as the key and a metadata object as the value.
For example, the preset saved above would look something like this in
all-windows-mochitests: selector: fuzzy description: >- Runs all windows mochitests. query: - "'win 'mochitest"
selector key (required) allows
mach try to determine which subcommand to dispatch to.
description key (optional in user presets but required for shared presets) is a human
readable string describing what the preset selects and when to use it. All other values in the
preset are forwarded to the specified selector as is.