Commit aa1db20f authored by Ned Nguyen's avatar Ned Nguyen Committed by Commit Bot

Switch all the runnable python script in tools/perf/ to use vpython

Change-Id: I5d39a8e928695164a18179f9a907c8af3fc1f6f0
Reviewed-on: https://chromium-review.googlesource.com/962985
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Reviewed-by: default avatarRobbie Iannucci <iannucci@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543267}
parent 250e22d9
...@@ -64,8 +64,9 @@ def _RunArgs(args, input_api): ...@@ -64,8 +64,9 @@ def _RunArgs(args, input_api):
def _CheckExpectations(input_api, output_api): def _CheckExpectations(input_api, output_api):
results = [] results = []
perf_dir = input_api.PresubmitLocalPath() perf_dir = input_api.PresubmitLocalPath()
vpython = 'vpython.bat' if input_api.is_windows else 'vpython'
out, return_code = _RunArgs([ out, return_code = _RunArgs([
input_api.python_executable, vpython,
input_api.os_path.join(perf_dir, 'validate_story_expectation_data')], input_api.os_path.join(perf_dir, 'validate_story_expectation_data')],
input_api) input_api)
if return_code: if return_code:
...@@ -77,8 +78,9 @@ def _CheckExpectations(input_api, output_api): ...@@ -77,8 +78,9 @@ def _CheckExpectations(input_api, output_api):
def _CheckPerfData(input_api, output_api, block_on_failure): def _CheckPerfData(input_api, output_api, block_on_failure):
results = [] results = []
perf_dir = input_api.PresubmitLocalPath() perf_dir = input_api.PresubmitLocalPath()
vpython = 'vpython.bat' if input_api.is_windows else 'vpython'
out, return_code = _RunArgs([ out, return_code = _RunArgs([
input_api.python_executable, vpython,
input_api.os_path.join(perf_dir, 'generate_perf_data'), input_api.os_path.join(perf_dir, 'generate_perf_data'),
'--validate-only'], input_api) '--validate-only'], input_api)
if return_code: if return_code:
...@@ -103,8 +105,9 @@ def _CheckWprShaFiles(input_api, output_api): ...@@ -103,8 +105,9 @@ def _CheckWprShaFiles(input_api, output_api):
continue continue
wpr_archive_shas.append(filename) wpr_archive_shas.append(filename)
vpython = 'vpython.bat' if input_api.is_windows else 'vpython'
out, return_code = _RunArgs([ out, return_code = _RunArgs([
input_api.python_executable, vpython,
input_api.os_path.join(perf_dir, 'validate_wpr_archives')] + input_api.os_path.join(perf_dir, 'validate_wpr_archives')] +
wpr_archive_shas, wpr_archive_shas,
input_api) input_api)
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2015 The Chromium Authors. All rights reserved. # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
...@@ -211,7 +211,7 @@ def ZipDependencies(target_paths, dependencies, options): ...@@ -211,7 +211,7 @@ def ZipDependencies(target_paths, dependencies, options):
relative_path = os.path.relpath(target_path, base_dir) relative_path = os.path.relpath(target_path, base_dir)
link_script = ( link_script = (
'#!/usr/bin/env python\n\n' '#!/usr/bin/env vpython\n\n'
'import os\n' 'import os\n'
'import sys\n\n\n' 'import sys\n\n\n'
'script = os.path.join(os.path.dirname(__file__), \'%s\')\n' 'script = os.path.join(os.path.dirname(__file__), \'%s\')\n'
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2015 The Chromium Authors. All rights reserved. # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2013 The Chromium Authors. All rights reserved. # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2015 The Chromium Authors. All rights reserved. # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2018 The Chromium Authors. All rights reserved. # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment