gecko-dev/tools/tryselect/test/test_preset.t
Andrew Halberstadt 4984a86e83 Bug 1464419 - [tryselect] Ability to specify --query multiple times with |mach try fuzzy| r=jmaher
Currently it's possible to specify a single query and take the union of terms with the '|'
symbol. However if you want to craft anything more complicated (i.e linux mochitest and
xpcshell, but windows reftest), it becomes really difficult. This allows developers to union
the result of multiple queries.

For example:
./mach try fuzzy -q "'linux 'mochitest | 'xpschell" -q "'windows 'reftest"

Differential Revision: https://phabricator.services.mozilla.com/D1838
2018-06-26 22:08:07 +00:00

130 lines
2.9 KiB
Raku

$ . $TESTDIR/setup.sh
$ cd $topsrcdir
Test preset with no subcommand
$ ./mach try $testargs --save foo -b do -p linux -u mochitests -t none --tag foo
Commit message:
try: -b do -p linux -u mochitests -t none --tag foo
Pushed via `mach try syntax`
preset saved, run with: --preset=foo
$ ./mach try $testargs --preset foo
Commit message:
try: -b do -p linux -u mochitests -t none --tag foo
Pushed via `mach try syntax`
$ ./mach try syntax $testargs --preset foo
Commit message:
try: -b do -p linux -u mochitests -t none --tag foo
Pushed via `mach try syntax`
$ ./mach try $testargs --list-presets
foo: -b do -p linux -u mochitests -t none --tag foo
$ unset EDITOR
$ ./mach try $testargs --edit-presets
error: must set the $EDITOR environment variable to use --edit-presets
$ export EDITOR=cat
$ ./mach try $testargs --edit-presets
[try]
foo = -b do -p linux -u mochitests -t none --tag foo
Test preset with syntax subcommand
$ ./mach try syntax $testargs --save bar -b do -p win32 -u none -t all --tag bar
Commit message:
try: -b do -p win32 -u none -t all --tag bar
Pushed via `mach try syntax`
preset saved, run with: --preset=bar
$ ./mach try syntax $testargs --preset bar
Commit message:
try: -b do -p win32 -u none -t all --tag bar
Pushed via `mach try syntax`
$ ./mach try $testargs --preset bar
Commit message:
try: -b do -p win32 -u none -t all --tag bar
Pushed via `mach try syntax`
$ ./mach try syntax $testargs --list-presets
foo: -b do -p linux -u mochitests -t none --tag foo
bar: -b do -p win32 -u none -t all --tag bar
$ ./mach try syntax $testargs --edit-presets
[try]
foo = -b do -p linux -u mochitests -t none --tag foo
bar = -b do -p win32 -u none -t all --tag bar
Test preset with fuzzy subcommand
$ ./mach try fuzzy $testargs --save baz -q "'baz"
preset saved, run with: --preset=baz
Commit message:
Fuzzy query='baz
Pushed via `mach try fuzzy`
Calculated try_task_config.json:
{
"tasks":[
"build-baz"
]
}
$ ./mach try fuzzy $testargs --preset baz
Commit message:
Fuzzy query='baz
Pushed via `mach try fuzzy`
Calculated try_task_config.json:
{
"tasks":[
"build-baz"
]
}
$ ./mach try fuzzy $testargs --preset baz -q "'foo"
Commit message:
Fuzzy query='foo&query='baz
Pushed via `mach try fuzzy`
Calculated try_task_config.json:
{
"tasks":[
"build-baz",
"test/foo-debug",
"test/foo-opt"
]
}
$ ./mach try $testargs --preset baz
Commit message:
Fuzzy query='baz
Pushed via `mach try fuzzy`
Calculated try_task_config.json:
{
"tasks":[
"build-baz"
]
}
$ ./mach try fuzzy $testargs --list-presets
baz: 'baz
$ ./mach try fuzzy $testargs --edit-presets
[try]
foo = -b do -p linux -u mochitests -t none --tag foo
bar = -b do -p win32 -u none -t all --tag bar
[fuzzy]
baz = 'baz