test(core): download emulators concurrently

[no changelog]
This commit is contained in:
Roman Zeyde
2026-01-16 10:53:49 +01:00
committed by Roman Zeyde
parent 094ecaef1c
commit 199e7486b3

View File

@@ -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))