テスト並列化 - CI/CD 用語集の定義
テスト並列化とは、テストスイートを複数の worker、プロセス、またはマシンで一度に実行し、実時間を短縮することです。スイートは同時に実行される shard に分割されます。
CI をどう高速化するか
20 分のシリアルなスイートを 4 つの shard に分割すると、オーバーヘッドを加えておよそ 5 分で完了します。GitHub Actions はこれを strategy.matrix で行い、pytest-xdist(-n auto)のような runner は 1 台のマシン内で並列化します。
落とし穴
並列化は状態を共有するテストを露呈させます。シリアルでは通るのに一緒に実行すると失敗するテストは、たいてい fixture をリークしているか、実行順序に依存しています。
関連ガイド
Matrix Build - CI/CD Glossary DefinitionMatrix Build: A **matrix build** expands one job into many parallel jobs across combinations of variables (ve…
Test Isolation - CI/CD Glossary DefinitionTest isolation ensures each test runs independently with its own clean state, so ordering and shared data can…
Test Runner - CI/CD Glossary DefinitionTest Runner: A test runner is the tool that discovers test cases, executes them, and reports pass/fail result…