Support parallel tests with external database
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 32/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- postgresql, python
- Ambito
- databases, testing-qa
Direzione di ricerca
Inizia tracciando l’attuale esecuzione parallela basata su fork di mutmut e il modo in cui i risultati delle mutazioni vengono scritti nei file foo.py.meta. Confronta il comportamento dei worker e dei session-fixture descritto nella documentazione di pytest-xdist. Il lavoro è completo quando i worker paralleli possono inizializzare database PostgreSQL isolati, eseguire mutazioni senza conflitti e aggregare i risultati in modo sicuro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Similar to pytest-xdist: https://pytest-xdist.readthedocs.io/en/stable/how-to.html
I'm not sure yet how to implement this in mutmut, as the pytest setup is different (in pytest-xdist, session fixtures are run once per worker. Not sure how we could replicate this use case in mutmut)
I have a project which connects to a local postgres instance for integration tests. When running tests in parallel, they should connect to different databases on this instance, otherwise they would conflict with each other (e.g. test A deletes data from some table, while test B tries to read from this table). This means I currently cannot run these tests with mutmut.
The setup with pytest-xdist is:
- start e.g. 12 processes with
PYTEST_XDIST_WORKERset togw1,gw2, ..., gw12` - for each process, it runs the pytest session fixture to setup the database
2.1. The fixture connects to postgres and creates a databasetest_db_{PYTEST_XDIST_WORKER}
2.2. Afterwards, we have 12 different databases - When running a test, it runs against the
test_db_{PYTEST_XDIST_WORKER}database
Therefore, each worker uses its own database.
I think something like step (1) would be rather straightforward: We use fork and do not have explicit workers, but we run at most n processes in parallel. We could create n ids, keep track of which ids are still free, and everytime we fork another process we take one of the free ids.
However, I'm not sure how we would go about running session fixtures once per "worker". I suppose, we would could:
spawn(and notfork) 12 worker processes- set
MUTMUT_WORKER_1/2/.../12 - In each process run the complete test suite / an init method (for caching and running the database setup fixtures)
- Split the mutants across the workers (or use a multiprocessing queue/...)
- Inside of the worker, we sequentially run a single
forkto create isolated copies of the worker process (with everything already setup) and run tests for mutations there - Workers write their results into a results queue and the main process saves the stats in files (we should not write the
foo.py.metafiles from different processes)
- Lingua principale
- Python
- Stelle
- 1.5k
- Fork
- 182
- Merge medio
- 2g 14h
- PR unite (30g)
- 3
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 boxed/mutmut
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
`run` with a `name__mutmut_*` pattern runs the whole test suite in the clean-test checkForse già presa @Ishaan400 l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
boxed/mutmut#592 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Invalid unary plus generated in match statementForse già presa @GhostCoder6969 l’ha presa 20 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 3 giorni
-
What do the emoji's mean?Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
boxed/mutmut#560 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
boxed/mutmut#529 · 7 commenti ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di boxed/mutmut
Issue simili
-
good first issue tools
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug deferred domain:ci P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
get_page_thumbnail modifies cached page images, affecting later thumbnails and picture exportsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
docling-project/docling-mcp#147 ·
-
issue: A pipe model's Valves button ignores the Allow Chat Valves permissionForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-webui/open-webui#32771 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Scheduled Security Scan is failing on mainForse già presa @pkupt l’ha presa oggi. Apertasecurity-scan-failure
Difficoltà 1/5 1-3 ore Idoneità per principianti 74/100
semantica-agi/semantica#2045 ·
I maintainer di solito rispondono entro 2 giorni