Test Sharding - CI/CD用語集の定義
テストシャーディングは、スイートをサブセットに分割し、別々のrunnerで並列に実行して総時間を短縮します。
テストシャーディングとは、テストスイートを独立したサブセット(シャード)に分割し、別々のrunnerで並列に実行してから結果を結合する手法です。大規模なスイートの実時間を短縮します。
GitHub Actionsは、各jobにシャードのインデックスを渡すmatrixを通じてシャーディングをサポートします。過去の実行時間でシャードを均衡させることで、遅いシャード1つが支配的になるのを避けられます。
CIでは
シャードのインデックスと総数を持つ strategy.matrix が一般的なパターンです。各jobは自分のスライスを実行し、結合のために結果をartifactsとしてアップロードします。
関連ガイド
Parallel Test Execution - CI/CD Glossary DefinitionParallel Test Execution: Parallel test execution runs multiple tests or test files at the same time, within o…
Test Selection - CI/CD Glossary DefinitionTest Selection: Test selection runs only the tests affected by a change instead of the whole suite, using a d…
Matrix Build - CI/CD Glossary DefinitionMatrix Build: A **matrix build** expands one job into many parallel jobs across combinations of variables (ve…