зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1640171 - Make the test file a str before using it. r=mozperftest-reviewers,tarek
This patch fixes a bug where a PosixPath is attempted to be used rather than a string path. There's also a regression in the coverage test run in `./mach perftest-test` on some platforms that is fixed by this patch (the attrs module being used by pytest is too old, so we update during setup). Lastly, a regression test is added to the browsertime tests to ensure that the command only contains knowingly compatible types. Depends on D76713 Differential Revision: https://phabricator.services.mozilla.com/D76599
This commit is contained in:
Родитель
88c2ed6ab9
Коммит
f94f60a9c2
|
@ -46,7 +46,7 @@ class Options:
|
|||
},
|
||||
"--hooks": {
|
||||
"type": str,
|
||||
"default": "",
|
||||
"default": None,
|
||||
"help": "Script containing hooks. Can be a path or a URL.",
|
||||
},
|
||||
"--verbose": {"action": "store_true", "default": False, "help": "Verbose mode"},
|
||||
|
|
|
@ -45,7 +45,7 @@ class Perfherder(Layer):
|
|||
"refbrow",
|
||||
],
|
||||
"help": "Shorthand name of application that is "
|
||||
"being tested (used in perfherder data).",
|
||||
"being tested (used in perfherder data).",
|
||||
},
|
||||
"metrics": {
|
||||
"nargs": "*",
|
||||
|
|
|
@ -36,10 +36,15 @@ def test_browser(*mocked):
|
|||
b(metadata)
|
||||
finally:
|
||||
shutil.rmtree(mach_cmd._mach_context.state_dir)
|
||||
|
||||
assert mach_cmd.run_process.call_count == 1
|
||||
|
||||
# XXX more checks
|
||||
assert mach_cmd.run_process.call_args[0][-1][-1] == EXAMPLE_TEST
|
||||
|
||||
# Make sure all arguments are of type str
|
||||
for option in mach_cmd.run_process.call_args[0][0]:
|
||||
assert isinstance(option, str)
|
||||
|
||||
cmd = " ".join(mach_cmd.run_process.call_args[0][0])
|
||||
assert "--firefox.geckodriverPath GECKODRIVER" in cmd
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ def build_test_list(tests, randomized=False):
|
|||
test = Path(test)
|
||||
|
||||
if test.is_file():
|
||||
res.append(test)
|
||||
res.append(str(test))
|
||||
elif test.is_dir():
|
||||
for file in test.rglob("perftest_*.js"):
|
||||
res.append(str(file))
|
||||
|
|
Загрузка…
Ссылка в новой задаче