Make optional the auto-erase of the records, added by `haveInDatabase()`
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
まず、haveInDatabase() の実装と skip_cleanup_if_failed の設定処理を見つけます。テスト後にレコードが自動的に削除される箇所を追跡し、選択した boolean 設定によってその動作を無効化できることを確認します。その際、既存のデフォルト値と失敗時のクリーンアップ動作は維持します。
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- PHP
- スター
- 23
- フォーク
- 31
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-db のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
Codeception/module-db#87 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Codeception/module-db#85 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#67 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
Codeception/module-db#58 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
Codeception/module-db#54 ·
Codeception/module-db の issue をすべて見る
似ている issue
-
status/awaiting_triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
WordPress/plugin-check#1486 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
az-digital/az_quickstart#6019 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
grokability/snipe-it#19688 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100