Atlas › 16 CI/CD Pipelines › Testing Pyramid in CI☰ Read as one page
Testing Pyramid in CI
3.1Structuring Pipeline Stages Around the Test PyramidNot all tests belong at the same stage. The testing pyramid dictates not just what kinds of tests you write, but when they run in your…3.2Stage 1: On Every Push (Seconds to Minutes)This is the fastest feedback loop. Developers get results before they context-switch away from the code they just wrote.3.3Stage 2: On Pull Request / Merge to Develop (Minutes)This stage runs when code is proposed for integration. It catches issues that require real infrastructure -- databases, message queues…3.4Stage 3: On Merge to Main / Pre-Deploy (Minutes to Tens of Minutes)This is the final validation before code reaches users. Run the expensive, thorough tests here.3.5Stage 4: Post-Deploy (Continuous)After deployment, testing does not stop. Post-deploy checks verify that the application works in the actual production environment.3.6Common Mistakes in Pipeline Test StructureIf browser tests run on every push, developers wait 20 minutes for feedback on a one-line fix. Run only fast tests on push; save expensive…3.7Mapping Test Types to Pipeline Stages3.8Hands-On Exercise1. Map your current test suite to the four pipeline stages. Which stage is each test type in? Are any stages missing? 2. Measure the…