| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Run Performance Test Bisect Tool | 6 """Run Performance Test Bisect Tool |
| 7 | 7 |
| 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py | 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py |
| 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will | 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will |
| 10 check out a copy of the depot in a subdirectory 'bisect' of the working | 10 check out a copy of the depot in a subdirectory 'bisect' of the working |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 # since it will return an error if it wasn't running. | 84 # since it will return an error if it wasn't running. |
| 85 self._Stop() | 85 self._Stop() |
| 86 | 86 |
| 87 if subprocess.call([self._abs_path_to_goma_file, 'start']): | 87 if subprocess.call([self._abs_path_to_goma_file, 'start']): |
| 88 raise RuntimeError('Goma failed to start.') | 88 raise RuntimeError('Goma failed to start.') |
| 89 | 89 |
| 90 def _Stop(self): | 90 def _Stop(self): |
| 91 subprocess.call([self._abs_path_to_goma_file, 'stop']) | 91 subprocess.call([self._abs_path_to_goma_file, 'stop']) |
| 92 | 92 |
| 93 | 93 |
| 94 def _LoadConfigFile(config_file_path): | 94 def _LoadConfigFile(path_to_file): |
| 95 """Loads the given file as a python module and returns the config dictionary. | 95 """Attempts to load the specified config file as a module |
| 96 | 96 and grab the global config dict. |
| 97 The config file is loaded as a Python module. | |
| 98 | 97 |
| 99 Args: | 98 Args: |
| 100 config_file_path: Path to the config file. | 99 config_file_path: Path to the config file. |
| 101 | 100 |
| 102 Returns: | 101 Returns: |
| 103 If successful, returns the config dict loaded from the file. If no | 102 If successful, returns the config dict loaded from the file. If no |
| 104 such dictionary could be loaded, returns the empty dictionary. | 103 such dictionary could be loaded, returns the empty dictionary. |
| 105 """ | 104 """ |
| 106 try: | 105 try: |
| 107 local_vars = {} | 106 local_vars = {} |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 config, current_dir, opts.path_to_goma) | 550 config, current_dir, opts.path_to_goma) |
| 552 | 551 |
| 553 print ('Error: Could not load config file. Double check your changes to ' | 552 print ('Error: Could not load config file. Double check your changes to ' |
| 554 'run-bisect-perf-regression.cfg or run-perf-test.cfg for syntax ' | 553 'run-bisect-perf-regression.cfg or run-perf-test.cfg for syntax ' |
| 555 'errors.\n') | 554 'errors.\n') |
| 556 return 1 | 555 return 1 |
| 557 | 556 |
| 558 | 557 |
| 559 if __name__ == '__main__': | 558 if __name__ == '__main__': |
| 560 sys.exit(main()) | 559 sys.exit(main()) |
| OLD | NEW |