A pipeline with five stages
Example, not the course's numbers
Your order
- Lint1 min, fails 15%reached 100%
- Unit tests4 min, fails 12%reached 85%
- Build the image6 min, fails 5%reached 75%
- End to end tests15 min, fails 8%reached 71%
- Dependency scan3 min, fails 3%reached 65%
- Average minutes to an answer
- 21.5
- Fastest order
- 21.3
The rule, in words
- Stages run one after another, and a run stops at its first failing stage.
- A stage only costs its minutes when every stage before it passed, so its cost is its minutes times the chance that it is reached.
- The average time to an answer is the sum of those costs.
- The fastest order sorts by minutes divided by failure chance, smallest first. A stage that never fails goes last.
Invented numbers, and failures treated as independent. Real stages share causes and real pipelines also run stages in parallel and cache results.
