(context)
| 703 | |
| 704 | |
| 705 | async def run_testbed(context): |
| 706 | setup_ci() |
| 707 | setup_sdk() |
| 708 | setup_testbed() |
| 709 | |
| 710 | if context.managed: |
| 711 | # In this mode, Gradle will create a device with an unpredictable name. |
| 712 | # So we save a list of the running devices before starting Gradle, and |
| 713 | # find_device then waits for a new device to appear. |
| 714 | initial_devices = await list_devices() |
| 715 | else: |
| 716 | # In case the previous shutdown was unclean, make sure the app isn't |
| 717 | # running, otherwise we might show logs from a previous run. This is |
| 718 | # unnecessary in --managed mode, because Gradle creates a new emulator |
| 719 | # every time. |
| 720 | stop_app(context.connected) |
| 721 | initial_devices = None |
| 722 | |
| 723 | try: |
| 724 | async with asyncio.TaskGroup() as tg: |
| 725 | tg.create_task(logcat_task(context, initial_devices)) |
| 726 | tg.create_task(gradle_task(context)) |
| 727 | except* MySystemExit as e: |
| 728 | raise SystemExit(*e.exceptions[0].args) from None |
| 729 | except* CalledProcessError as e: |
| 730 | # If Python produced no output, then the user probably wants to see the |
| 731 | # verbose output to explain why the test failed. |
| 732 | if not python_started: |
| 733 | for stream, line in hidden_output: |
| 734 | stream.write(line) |
| 735 | |
| 736 | # Extract it from the ExceptionGroup so it can be handled by `main`. |
| 737 | raise e.exceptions[0] |
| 738 | |
| 739 | |
| 740 | def package_version(prefix_dir): |
nothing calls this directly
no test coverage detected
searching dependent graphs…