fune/tools/tryselect/test/test_fuzzy.py
Edwin Takahashi eee843b9a7 Bug 1602863 - run xpcshell suite on ubuntu1804 test image for all linux variants except ccov r=jmaher
Changes:

Run `xpcshell` test suite on ubuntu1804 for all platforms except `linux64-ccov`.

Modify the test in `test_fuzzy.py` to refer to the new `test-linux1804` xpcshell task label.

Add a new test in `test_fuzzy.py` to test the `-q` functionality without a test path.

Differential Revision: https://phabricator.services.mozilla.com/D58740

--HG--
extra : moz-landing-system : lando
2020-01-07 18:31:55 +00:00

50 lines
1.4 KiB
Python

# 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/.
from __future__ import absolute_import, print_function, unicode_literals
import os
import mozunit
import pytest
@pytest.mark.skipif(os.name == 'nt', reason="fzf not installed on host")
def test_query_paths(run_mach, capfd):
cmd = ['try', 'fuzzy', '--no-push',
'-q', "'test-linux1804-64/opt-xpcshell", 'caps/tests/unit/test_origin.js']
assert run_mach(cmd) == 0
output = capfd.readouterr().out
print(output)
# If there are more than one tasks here, it means that something went wrong
# with the path filtering.
expected = """
"tasks": [
"test-linux1804-64/opt-xpcshell-e10s-1"
]""".lstrip()
assert expected in output
@pytest.mark.skipif(os.name == 'nt', reason="fzf not installed on host")
def test_query(run_mach, capfd):
cmd = ['try', 'fuzzy', '--no-push', '-q', "'source-test-python-taskgraph-tests-py2"]
assert run_mach(cmd) == 0
output = capfd.readouterr().out
print(output)
# Should only ever mach one task exactly.
expected = """
"tasks": [
"source-test-python-taskgraph-tests-py2"
]""".lstrip()
assert expected in output
if __name__ == '__main__':
mozunit.main()