For #21700: Fixed output path to be in app/build

This commit is contained in:
Marc Leclair 2021-10-12 14:06:16 -04:00 committed by mergify[bot]
parent 27cd609d0f
commit dede8a1ca4
1 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ the JSON output file in firefox (or another browser of your choice if you pass t
"""
ff_browser = 'firefox'
target_directory = '{cwd}/app/build/'.format(cwd=os.getcwd())
output_path = '/storage/emulated/0/benchmark/'
output_file = 'org.mozilla.fenix-benchmarkData.json'
file_url = "file:///"
@ -36,13 +37,14 @@ def run_benchmark(class_to_test):
def fetch_benchmark_results():
subprocess.run(
['adb', 'pull', "{path}{file}".format(path=output_path, file=output_file)],
check=True, text=True)
cwd=target_directory,check=True, text=True)
print("The benchmark results can be seen here: {file_path}"
.format(file_path=os.path.abspath("./{file}".format(file=file_url))))
def open_in_browser():
abs_path = os.path.abspath("./{file}".format(file=output_file))
abs_path = os.path.abspath("{target_directory}{file}".format(target_directory=target_directory,
file=output_file))
webbrowser.get(ff_browser).open_new(file_url+abs_path)