Testing: session scoped fixture for required model loading
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Inizia con tests/load_models.py, tests/unload_models.py e conftest.py, poi esamina il workflow esistente tox -e load-test-models e le indicazioni collegate su fixture e marker di pytest. Implementa una gestione con ambito di sessione che rilevi i test lmstudio selezionati, tenga facoltativamente traccia dei relativi ID dei modelli e conservi i modelli richiesti; il lavoro è completato quando i test non richiedono più una configurazione separata per il caricamento dei modelli e -m "not lmstudio" ne eviti il caricamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The tests/load_models.py/tests/unload_models.py scripts that handle loading and unloading the models used by the test suite currently need to be invoked separately from the test suite execution.
While this approach works, it does mean that you can easily get spurious failures if you forget to run tox -e load-test-models before a local testing session.
We could potentially add a session scoped fixture in conftest.py to get pytest to natively handle ensuring that the required models have been loaded rather than needing to manage it externally: https://stackoverflow.com/questions/76608690/pytest-best-practice-to-setup-and-teardown-before-and-after-all-tests
To avoid pointlessly setting up the models when -m "not lmstudio" has been passed, the fixture should scan the loaded modules and ensure the models are only loaded if that mark is present on at least one selected test (see https://docs.pytest.org/en/stable/example/markers.html and https://docs.pytest.org/en/stable/example/special.html)
To make it even more efficient, the lmstudio marker could potentially be parameterised with the model IDs that a given test expects to already have loaded. For example:
@pytest.mark.lmstudio(models=[EXPECTED_LLM_ID, EXPECTED_EMBEDDING_ID])
def test_list_downloaded_models_async() -> None:
...
When scanning the selected test nodes, the fixture would keep track of the named models, and ensure those models were loaded before running any tests. To avoid problems with unexpected JIT model unloading during the test suite execution, the fixture would still mark models to remain loaded indefinitely.
- Lingua principale
- Python
- Stelle
- 885
- Fork
- 168
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lmstudio-ai/lmstudio-python
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
lmstudio-ai/lmstudio-python#186 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
lmstudio-ai/lmstudio-python#184 · 1 commento · 1 reazione ·
-
Reasoning parametersAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
lmstudio-ai/lmstudio-python#183 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
lmstudio-ai/lmstudio-python#182 · 1 reazione ·
-
error code: 502Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
lmstudio-ai/lmstudio-python#180 ·
Tutte le issue di lmstudio-ai/lmstudio-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
gramaziokohler/compas_timber#870 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
autowarefoundation/autoware_carla_scenario#500 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue priority: low size: XS testing
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
cubrid-lab/cubrid-mcp-server#385 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue priority: low size: S testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
cubrid-lab/cubrid-cookbook-python#447 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100