Esempio n. 1
0
    async def run_with_client(self, args: Namespace,
                              client: IdbClient) -> None:
        await super().run_with_client(args, client)
        tests_to_run = self.get_tests_to_run(args)
        tests_to_skip = self.get_tests_to_skip(args)
        app_bundle_id = args.app_bundle_id if hasattr(
            args, "app_bundle_id") else None
        test_host_app_bundle_id = (args.test_host_app_bundle_id if hasattr(
            args, "test_host_app_bundle_id") else None)
        arguments = getattr(args, "test_arguments", [])
        is_ui = args.run == "ui"
        is_logic = args.run == "logic"

        formatter = json_format_test_info if args.json else human_format_test_info
        async for test_result in client.run_xctest(
                test_bundle_id=args.test_bundle_id,
                app_bundle_id=app_bundle_id,
                test_host_app_bundle_id=test_host_app_bundle_id,
                is_ui_test=is_ui,
                is_logic_test=is_logic,
                tests_to_run=tests_to_run,
                tests_to_skip=tests_to_skip,
                timeout=args.timeout,
                env=get_env_with_idb_prefix(),
                args=arguments,
                result_bundle_path=args.result_bundle_path,
        ):
            print(formatter(test_result))
Esempio n. 2
0
 async def run_with_client(self, args: Namespace,
                           client: IdbClient) -> None:
     async for chunk in client.tail_logs(
             stop=signal_handler_event("log"),
             arguments=self.normalise_log_arguments(args.log_arguments),
     ):
         print(chunk, end="")
     print("")
Esempio n. 3
0
File: dsym.py Progetto: zlhope/idb
 async def run_with_client(self, args: Namespace, client: IdbClient) -> None:
     async for install_response in client.install_dsym(args.dsym_path):
         if install_response.progress != 0.0 and not args.json:
             print("Installed {install_response.progress}%")
         elif args.json:
             print(json.dumps({"dsym": install_response.name}))
         else:
             print(f"Installed: {install_response.name}")
Esempio n. 4
0
 async def run_with_client(self, args: Namespace,
                           client: IdbClient) -> None:
     async for data in signal_handler_generator(
             iterable=client.stream_video(
                 output_file=args.output_file,
                 fps=args.fps,
                 format=_FORMAT_CHOICE_MAP[args.format],
             ),
             name="stream",
             logger=self.logger,
     ):
         sys.stdout.buffer.write(data)
Esempio n. 5
0
 async def run_with_client(self, args: Namespace, client: IdbClient) -> None:
     async for install_response in client.install_xctest(args.test_bundle_path):
         if install_response.progress != 0.0 and not args.json:
             print("Installed {install_response.progress}%")
         elif args.json:
             print(
                 json.dumps(
                     {
                         "installedTestBundleId": install_response.name,
                         "uuid": install_response.uuid,
                     }
                 )
             )
         else:
             print(f"Installed: {install_response.name} {install_response.uuid}")
Esempio n. 6
0
File: app.py Progetto: zlhope/idb
 async def run_with_client(self, args: Namespace,
                           client: IdbClient) -> None:
     artifact: Optional[InstalledArtifact] = None
     async for info in client.install(args.bundle_path):
         artifact = info
         progress = info.progress
         if progress is None:
             continue
         self.logger.info(f"Progress: {progress}")
     if args.json:
         print(
             json.dumps({
                 "installedAppBundleId": none_throws(artifact).name,
                 "uuid": none_throws(artifact).uuid,
             }))
     else:
         print(
             f"Installed: {none_throws(artifact).name} {none_throws(artifact).uuid}"
         )
Esempio n. 7
0
 async def run_with_client(self, args: Namespace,
                           client: IdbClient) -> None:
     async for chunk in client.tail_companion_logs(
             stop=signal_handler_event("log")):
         print(chunk, end="")
     print("")
Esempio n. 8
0
 async def install_bundles(self, args: Namespace, client: IdbClient) -> None:
     await super().install_bundles(args, client)
     async for app in client.install(args.test_host_app_bundle_id):
         args.test_host_app_bundle_id = app.name
Esempio n. 9
0
 async def install_bundles(self, args: Namespace, client: IdbClient) -> None:
     async for test in client.install_xctest(args.test_bundle_id):
         args.test_bundle_id = test.name