diff --git a/moz.build b/moz.build index f86d7f22ef31..8672b11b91ef 100644 --- a/moz.build +++ b/moz.build @@ -64,6 +64,7 @@ DIRS += [ 'taskcluster', 'testing/mozbase', 'third_party/python', + 'tools', ] if not CONFIG['JS_STANDALONE']: diff --git a/taskcluster/ci/source-test/cram.yml b/taskcluster/ci/source-test/cram.yml new file mode 100644 index 000000000000..2c8dcf9c7f4d --- /dev/null +++ b/taskcluster/ci/source-test/cram.yml @@ -0,0 +1,20 @@ +--- +tryselect: + description: tools/tryselect integration tests + platform: linux64/opt + treeherder: + symbol: cram(try) + kind: test + tier: 2 + worker-type: aws-provisioner-v1/gecko-t-linux-xlarge + worker: + docker-image: {in-tree: "lint"} + max-run-time: 1800 + run: + using: mach + mach: cramtest tools/tryselect + when: + files-changed: + - testing/mach_commands.py + - third_party/python/cram/** + - tools/tryselect/** diff --git a/taskcluster/ci/source-test/kind.yml b/taskcluster/ci/source-test/kind.yml index 6a6f8c99ef9e..56af4412c375 100644 --- a/taskcluster/ci/source-test/kind.yml +++ b/taskcluster/ci/source-test/kind.yml @@ -1,7 +1,7 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. - +--- loader: taskgraph.loader.transform:loader transforms: @@ -10,21 +10,22 @@ transforms: - taskgraph.transforms.task:transforms jobs-from: - - python-tests.yml - - mocha.yml - - mozlint.yml - - doc.yml - - webidl.yml + - cram.yml + - doc.yml + - mocha.yml + - mozlint.yml + - python-tests.yml + - webidl.yml # This is used by run-task based tasks to lookup which build task it # should depend on based on its own platform. dependent-build-platforms: - linux64-asan/opt: - label: build-linux64-asan/opt - target-name: target.tar.bz2 - linux64/debug: - label: build-linux64/debug - target-name: target.tar.bz2 - linux64.*: - label: build-linux64/opt - target-name: target.tar.bz2 + linux64-asan/opt: + label: build-linux64-asan/opt + target-name: target.tar.bz2 + linux64/debug: + label: build-linux64/debug + target-name: target.tar.bz2 + linux64.*: + label: build-linux64/opt + target-name: target.tar.bz2 diff --git a/taskcluster/docker/lint/system-setup.sh b/taskcluster/docker/lint/system-setup.sh index bfa969490f27..84ec9c540d50 100644 --- a/taskcluster/docker/lint/system-setup.sh +++ b/taskcluster/docker/lint/system-setup.sh @@ -52,6 +52,23 @@ mv /build/node_modules /build/node_modules_eslint /build/tooltool.py fetch -m /tmp/eslint-plugin-mozilla.tt mv /build/node_modules /build/node_modules_eslint-plugin-mozilla +### +# fzf setup +### + +tooltool_fetch <> $cachedir/target_task_set << EOF +test/foo-opt +test/foo-debug +build-baz +EOF + +cat >> $cachedir/full_task_set << EOF +test/foo-opt +test/foo-debug +test/bar-opt +test/bar-debug +build-baz +EOF + +# set mtime to the future so we don't re-generate tasks +find $cachedir -type f -exec touch -d "next day" {} + + +export testargs="--no-push --no-artifact" diff --git a/tools/tryselect/test/test_fuzzy.t b/tools/tryselect/test/test_fuzzy.t new file mode 100644 index 000000000000..7fbab385c4ef --- /dev/null +++ b/tools/tryselect/test/test_fuzzy.t @@ -0,0 +1,23 @@ + $ . $TESTDIR/setup.sh + $ cd $topsrcdir + +Test fuzzy selector + + $ ./mach try fuzzy $testargs -q "'foo" + Calculated try selector: + { + "tasks":[ + "test/foo-debug", + "test/foo-opt" + ] + } + $ ./mach try fuzzy $testargs -q "'bar" + no tasks selected + $ ./mach try fuzzy $testargs --full -q "'bar" + Calculated try selector: + { + "tasks":[ + "test/bar-debug", + "test/bar-opt" + ] + } diff --git a/tools/tryselect/vcs.py b/tools/tryselect/vcs.py index aa423dbe566a..82df7377e4c5 100644 --- a/tools/tryselect/vcs.py +++ b/tools/tryselect/vcs.py @@ -83,7 +83,7 @@ class VCSHelper(object): if templates: try_task_config['templates'] = templates - json.dump(try_task_config, fh, indent=2) + json.dump(try_task_config, fh, indent=2, separators=(',', ':')) return config def check_working_directory(self, push=True):