()
| 11 | |
| 12 | |
| 13 | def main(): |
| 14 | parser = ArgumentParser() |
| 15 | parser.add_argument( |
| 16 | '-t', |
| 17 | '--blink-tools-path', |
| 18 | help=("Absolute path to where blink tools are located " |
| 19 | "(usually inside a local chromium checkout).")) |
| 20 | parser.add_argument( |
| 21 | '--config-path', |
| 22 | help="Absolute path to a project configuration json file.", |
| 23 | default=(Path(__file__).parent / 'v8configs.json')) |
| 24 | parser.add_argument( |
| 25 | '--approver', |
| 26 | help="Flag indicating that this run will only approve and merge " |
| 27 | "exisiting PRs. Approval of these PRs needs to be done by an account " |
| 28 | "different from the one that created the PR.", |
| 29 | action="store_true") |
| 30 | args, exporter_args = parser.parse_known_args(sys.argv) |
| 31 | |
| 32 | sys.path.append(args.blink_tools_path) |
| 33 | from blinkpy.common import exit_codes |
| 34 | from blinkpy.common.host import Host |
| 35 | from blinkpy.common.path_finder import add_depot_tools_dir_to_os_path |
| 36 | |
| 37 | from v8_exporter import V8TestExporter, V8TestApprover |
| 38 | from v8configs import config_from_file |
| 39 | |
| 40 | add_depot_tools_dir_to_os_path() |
| 41 | host = Host(project_config_factory=config_from_file(args.config_path)) |
| 42 | exporter = (V8TestApprover if args.approver else V8TestExporter)(host) |
| 43 | try: |
| 44 | success = exporter.main(exporter_args[1:]) |
| 45 | host.exit(0 if success else 1) |
| 46 | except KeyboardInterrupt: |
| 47 | host.print_('Interrupted, exiting') |
| 48 | host.exit(exit_codes.INTERRUPTED_EXIT_STATUS) |
| 49 | |
| 50 | |
| 51 | if __name__ == '__main__': |
no test coverage detected