How we sped up our CI/CD test runs from 18 minutes to 4

𝐇𝐨𝐰 𝐰𝐞 𝐬𝐩𝐞𝐝 𝐮𝐩 𝐨𝐮𝐫 𝐂𝐈/𝐂𝐃 𝐭𝐞𝐬𝐭 𝐫𝐮𝐧𝐬 𝐟𝐫𝐨𝐦 18 𝐦𝐢𝐧𝐮𝐭𝐞𝐬 𝐭𝐨 4 — 𝐰𝐢𝐭𝐡𝐨𝐮𝐭 𝐬𝐚𝐜𝐫𝐢𝐟𝐢𝐜𝐢𝐧𝐠 𝐜𝐨𝐯𝐞𝐫𝐚𝐠𝐞 Our pipeline was slow. Developers started merging before tests finished. Not great. This is what we did ???? 1️⃣ 𝐉𝐞𝐬𝐭 𝐟𝐨𝐫 𝐚𝐥𝐥 𝐜𝐨𝐦𝐦𝐢𝐭, 𝐏𝐥𝐚𝐲𝐰𝐫𝐢𝐠𝐡𝐭 𝐟𝐨𝐫 𝐏𝐑𝐬 Unit tests are fast and catch 80% of bugs. E2E tests are slow and catch the scary ones. Don't treat them equally. 2️⃣ 𝐄𝐯𝐞𝐫𝐲𝐭𝐡𝐢𝐧𝐠 𝐢𝐧 𝐩𝐚𝐫𝐚𝐥𝐥𝐞𝐥 Frontend, backend, and E2E streams all run in parallel. Most teams still execute sequentially because it's the default. 3️⃣ 𝐂𝐚𝐜𝐡𝐞 𝐚𝐠𝐠𝐫𝐞𝐬𝐬𝐢𝐯𝐞𝐥𝐲 Re-use node modules and build artifacts between runs. We saved about a minute per suite, small wins that add up. 4️⃣ 𝐒𝐦𝐨𝐤𝐞 𝐭𝐞𝐬𝐭𝐬 𝐝𝐞𝐩𝐥𝐨𝐲 𝐟𝐢𝐫𝐬𝐭 Critical user flows (login, checkout, core APIs) run immediately after deploy. Full E2E runs asynchronously later. 5️⃣ 𝐃𝐚𝐬𝐡𝐛𝐨𝐚𝐫𝐝𝐬, 𝐧𝐨𝐭 𝐒𝐥𝐚𝐜𝐤 𝐬𝐩𝐚𝐦 We built a simple report page. Devs actually look at it because it shows trends, not just red or green. The goal isn’t perfect coverage, it’s making tests fast enough that people actually run them. 💬 What's your CI time like now? If it's longer than 10 minutes, something's probably misconfigured. #springboot #reactjs #playwright #jest #testing #devops #tdd #softwareengineering #nextjs #nodejs #cicd #fullstack

To view or add a comment, sign in

Explore content categories