Make optional the auto-erase of the records, added by `haveInDatabase()`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia individuando l’implementazione di haveInDatabase() e la gestione della configurazione per skip_cleanup_if_failed. Traccia il punto in cui i record vengono eliminati automaticamente dopo i test, quindi verifica che l’impostazione booleana scelta possa disabilitare questo comportamento preservando il valore predefinito esistente e il comportamento di pulizia in caso di errore.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Currently, all records, added by haveInDatabase() method during test, are automatically removed after the end of the test.
Although this is a documented behaviour, for me it adds more confusion than profit.
In case when I need all the changes, made during test, to disappear after the test, I can't rely solely on this behaviour, because changes may be done not only by haveInDatabase(). So I still need to use other things for keeping tests isolated (wrapping tests in transactions, or to re-populate database from dump before each test, etc).
And in other case, when I do not need tests isolation, I am ok with the fact that each test changes something in database, so auto-erasing some records only adds confusion for me.
So, I'd like to be able to turn this behaviour off in my tests.
Currently we have a skip_cleanup_if_failed configuration parameter, but it does not give full control over the auto-erase, because allows to omit it only when tests fail (which should be the default behaviour, IMHO). Also, its name is confusing (see issue #67).
Proposed solution
Let's add another boolean configuration parameter, responsible for this auto-erase. For example, auto_erase, or cleanup (could be used after renaming current cleanup to repopulate - see issue #67)
- Lingua principale
- PHP
- Stelle
- 23
- Fork
- 31
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 Codeception/module-db
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
Codeception/module-db#87 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Codeception/module-db#85 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Codeception/module-db#67 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
Codeception/module-db#58 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Codeception/module-db#54 ·
Tutte le issue di Codeception/module-db
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Admissions heading updates Apertaa11y admissions.uiowa.edu needs grooming SiteImprove best practice
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Save States Menu Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
pluginsGLPI/datainjection#673 ·