summaryrefslogtreecommitdiff
path: root/.github/instructions/tests.instructions.md
diff options
context:
space:
mode:
Diffstat (limited to '.github/instructions/tests.instructions.md')
-rw-r--r--.github/instructions/tests.instructions.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/.github/instructions/tests.instructions.md b/.github/instructions/tests.instructions.md
new file mode 100644
index 0000000..64985c3
--- /dev/null
+++ b/.github/instructions/tests.instructions.md
@@ -0,0 +1,17 @@
+---
+applyTo: "tests/**/*.py"
+---
+
+# Test instructions
+
+- テストフレームワークはpytestとpytest-asyncioを使用する。
+- GPU不要の自動テストを標準とし、Diffusers、モデル、CUDAは小さなfakeまたはmonkeypatchで分離する。
+- 設定変更では、有効値、既定値、省略、旧値、未知値、境界値を必要に応じて表形式のparameterized testで
+ 検証する。
+- MCP変更ではTool数、名前、required/optional、enum、公開してはいけないプロパティ、返却contentを
+ 検証する。
+- pipeline構築変更では選択される実装クラス、`from_config`へ渡す元config、追加optionを検証する。
+- Service変更では全routing、単一ジョブ直列化、既知エラー分類、内部エラーのsanitizeを検証する。
+- 一時ファイルにはpytestの`tmp_path`を使用し、`data/`へfixtureや生成物を追加しない。
+- 時刻、ネットワーク、実モデルの有無に依存する不安定なテストを通常のテストスイートへ入れない。
+- バグ修正では、修正前に失敗し修正後に成功する回帰テストを追加する。