Recommend to load fixtures in `function _before()` and set `cleanup: false`?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- php
調査の方向性
まず https://codeception.com/docs/modules/Doctrine にある Doctrine モジュールのドキュメントと、cleanup、_before()、runShellCommand()、doctrine:fixtures:load を使用している issue の例を読んでください。cleanup のトランザクションによってテストの変更が外部コマンドから隠されるかどうかを再現し、その後、ドキュメントで cleanup: false と各テスト前の fixture の読み込みを推奨すべきかどうかを判断してください。
索引モデルが issue の本文から書いたものです。
説明
I'm observing that with cleanup: true, running external commands with $I->runShellCommand('php bin/console ...'); isn't working. I'm guessing this is due to the transaction, which prevents external processes to "see" the database contents created/modified by the test. Can you confirm this?
If so, I would suggest to change the recommendation at https://codeception.com/docs/modules/Doctrine to cleanup: false, and show people how to load their fixtures in function _before():
$I->runShellCommand('php bin/console doctrine:fixtures:load --no-interaction --env=test');
IMO the currently recommended way to cleanup after each test doesn't work out, since for some tests it's necessary to disable the transaction (see above) - which ultimately leads to a mess.
So I'm figuring the best approach would be to just reload the fixtures before each test.
What do you think? How do you handle that?
- 主要言語
- PHP
- スター
- 4
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-doctrine のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-doctrine#2 · コメント 1 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
Codeception/module-doctrine#6 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Codeception/module-doctrine の issue をすべて見る
似ている issue
-
tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
UX
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ProfessionalWiki/NeoWiki#1525 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug customer-reported
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MagnaCapax/PMSS#949 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Automattic/static-site-importer#1829 ·