Test Fixture - CI/CD用語集の定義
test fixture は、テストが実行される前に必要とする固定の基準状態です。シードされたデータ、一時ファイル、既知の状態のデータベース、あるいはテストが常に同じ条件から始まるようにセットアップされたモックサービスなどです。
Setup と teardown
fixture には状態を構築する setup フェーズと、それを解放する teardown フェーズがあります。フレームワークは setUp/tearDown(xUnit)、@BeforeEach/@AfterEach(JUnit)、または yield を使った pytest fixture のような hook を公開します。
CIでは
共有された外部状態(実際のデータベース、グローバルな一時ディレクトリ)に触れる fixture は、CI がテストを並列に実行するときの順序依存の失敗のよくある原因です。fixture のスコープはできるだけ狭くしてください。
関連ガイド
Test Harness - CI/CD Glossary DefinitionTest Harness: A test harness is the surrounding code and configuration that loads the system under test, driv…
Test Isolation - CI/CD Glossary DefinitionTest isolation ensures each test runs independently with its own clean state, so ordering and shared data can…
Flaky Test - CI/CD Glossary DefinitionFlaky Test: A **flaky test** passes and fails on the same code due to nondeterminism (races, timing, external…