Bug 1753769: "runcli.py" in tests should use explicit paths r=ahal

The new `mozlint` behaviour will always lean on the VCS
to only lint changed files.

However, in tests, the VCS is going to be slow and also provide
inconsistent data between tests. Additionally, in some contexts,
the VCS won't be available.

Resolve this by hardcoding a file to lint for each case.

Differential Revision: https://phabricator.services.mozilla.com/D138033
This commit is contained in:
Mitchell Hentges 2022-02-08 22:06:59 +00:00
Родитель e8424ded4d
Коммит 90c289dfa4
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -34,7 +34,7 @@ def run(parser, lintdir, files):
def test_cli_with_ascii_encoding(run, monkeypatch, capfd):
cmd = [sys.executable, "runcli.py", "-l=string", "-f=stylish"]
cmd = [sys.executable, "runcli.py", "-l=string", "-f=stylish", "files/foobar.js"]
env = os.environ.copy()
env["PYTHONPATH"] = os.pathsep.join(sys.path)
env["PYTHONIOENCODING"] = "ascii"

Просмотреть файл

@ -262,7 +262,7 @@ def test_keyboard_interrupt():
# quickly. The other (slow.yml) will run slowly. This way the first worker
# will be be stuck blocking on the ProcessPoolExecutor._call_queue when the
# signal arrives and the other still be doing work.
cmd = [sys.executable, "runcli.py", "-l=string", "-l=slow"]
cmd = [sys.executable, "runcli.py", "-l=string", "-l=slow", "files/foobar.js"]
env = os.environ.copy()
env["PYTHONPATH"] = os.pathsep.join(sys.path)
proc = subprocess.Popen(