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 はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- 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 ·
-
Fix a confusion between 'cleanup' and 'skip_cleanup_if_failed' configuration params対応中かも @iliayatsenko が 723 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#67 ·
-
inserting null on an autoincrement primary key prevents cleanup対応中かも @jtopenpetition が 1261 日前に担当しました。 オープン
難易度 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
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
documentation good first issue help wanted up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
AnikethTS/RunnerDeck#307 ·
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
Перевод устарел
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信