Bug 1680194 - Do not pass global mach arguments to raptor, r=sparky,perftest-reviewers.

Differential Revision: https://phabricator.services.mozilla.com/D98432
This commit is contained in:
Bob Clary 2020-12-02 19:16:19 +00:00
Родитель b5a086a37a
Коммит c32d005abf
1 изменённых файлов: 11 добавлений и 4 удалений

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

@ -301,9 +301,16 @@ class MachRaptor(MachCommandBase):
): # Equivalent to 'run_local' = True.
return 1
debug_command = "--debug-command"
if debug_command in sys.argv:
sys.argv.remove(debug_command)
# Remove mach global arguments from sys.argv to prevent them
# from being consumed by raptor. Treat any item in sys.argv
# occuring before "raptor" as a mach global argument.
argv = []
in_mach = True
for arg in sys.argv:
if not in_mach:
argv.append(arg)
if arg.startswith("raptor"):
in_mach = False
raptor = self._spawn(RaptorRunner)
device = None
@ -312,7 +319,7 @@ class MachRaptor(MachCommandBase):
if kwargs["power_test"] and is_android:
device = ADBDeviceFactory(verbose=True)
disable_charging(device)
return raptor.run_test(sys.argv[2:], kwargs)
return raptor.run_test(argv, kwargs)
except BinaryNotFoundException as e:
self.log(logging.ERROR, "raptor", {"error": str(e)}, "ERROR: {error}")
self.log(logging.INFO, "raptor", {"help": e.help()}, "{help}")