mirror of
https://github.com/trezor/trezor-firmware.git
synced 2026-02-20 00:33:30 +01:00
test(core): download emulators concurrently
[no changelog]
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import stat
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from http import HTTPStatus
|
||||
from pathlib import Path
|
||||
from typing import TypeAlias
|
||||
@@ -135,10 +136,14 @@ def download_emulators_for_model(model: str) -> None:
|
||||
all_releases = get_all_releases()
|
||||
emus = get_emulators_for_model(model, all_releases)
|
||||
|
||||
for emu in emus:
|
||||
def _run(emu: Emulator):
|
||||
emu.download()
|
||||
emu.set_as_executable()
|
||||
|
||||
with ThreadPoolExecutor(max_workers=8) as executor:
|
||||
for _ in executor.map(_run, emus):
|
||||
pass
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument("model", type=click.Choice(ALL_MODEL_NAMES, case_sensitive=True))
|
||||
|
||||
Reference in New Issue
Block a user