[Feature] Per-unit and per-class fixture configuration - PR welcome?
まだ誰も着手していません。
評価
調査の方向性
src/Codeception/Module/Yii2.php から始めて loadFixtures() を調査し、続いてリンクされた例と提案された実装を確認します。クラス属性とテスト属性についてプロジェクトが求める API、および fixturesMethod との互換性を確認します。fixture のデフォルト、上書き、無効化の動作について合意され、カバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Note: I may not be aware of all configuration options or available functionality, so please let me know if I'm missing something.
AFIK, there is the option to configure fixtures in the test configuration, as well as in the configured fixturesMethod (_fixtures).
In our project, humhub/humhub, we use the fixturesMethod to adjust the configured fixtures from the configuration based on the test case's need. Mainly to speed up tests that do not require db data or just a subset of it.
In some situations, however, it seems to make sense to collect several tests in one case, but only some of them do actually need the fixtures, or some need a different set.
Now we had the idea to use attributes to allow that fixtures to be configured: see examples and current suggested implementation (open for improvement).
The question of this issue is if there is interest that we would incorporate this feature into this project here, potentially in the loadFixtures() method. The logic could be
- If the
fixturesMethodis implemented, just use its result - Otherwise, check for class and test attributes and use their result, if present
If the new functionality is encapsulated in a public method (e.g. getTestFixtures()) and we would pass the yii2 module instance as an argument to the fixturesMethod for easy access, the fixturesMethod could still use that configuration and customize as required. By this, there would be full backwards-compatibility while supporting fixture configuration without the need to implement the fixturesMethod.
The annotations generally allow the following:
- define a default set of fixtures
- use a configuration array to reduce or extend the default set
- on test level, the class level can be overridden, also falling back to the original configuration
- a special class
FixturesNonewould simply disable any fixtures for the current test.
Thank you for considering this. Any feedback welcome.
Please note, the current code in the aforementioned PR is not designed to meet this project's guidelines. Happy to adapt accordingly if you'd be interested in considering an implementation in your code base.
- 主要言語
- PHP
- スター
- 19
- フォーク
- 42
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-yii2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Codeception/module-yii2#145 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Codeception/module-yii2#144 · コメント 1 件 · リアクション 1 件 ·
-
MongoDB supportオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Codeception/module-yii2#142 · コメント 4 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
Codeception/module-yii2#141 · コメント 1 件 ·
-
Unable to load yii\elasticsearch\ActiveRecord-based fixtures再び着手できるかも @Mikk36 が 383 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
Codeception/module-yii2#134 · コメント 4 件 · 担当者 1 名 ·
Codeception/module-yii2 の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
fe: spell out "Auto increment" in the table editor, "AI" reads as artificial intelligence todayオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
landsman/adminer-desktop#120 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
dependabot/dependabot-core#16547 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
glpi-project/glpi#25922 ·
メンテナーはふだん 1 日以内に返信