DevOps Foundations · Module 6: CI basics and artifact discipline · Lab
Build a Pipeline That Really Stops on a Failing Test
45 min hands-on · Core
A free CI environment (platform free tier or local runner) with a small repo under /tmp/dlab-m06-01.
Two ways to do this lab: in your browser on Killercoda (free, no install), or on your own machine as a local guide. Killercoda runs one free scenario at a time: if you see a waiting queue, close other Killercoda tabs and wait a minute.
Objectives
- Order stages so cheap checks run before slow builds
- Prove a failing test halts every downstream stage
- Read the run record and name the stage that rejected the change
Step 1
Lay the stages in cost order
Write a pipeline with checkout, lint plus unit tests, build, and a package step that only runs on green. Keep the blocking path under ten minutes and record each stage duration.
Step 2
Introduce a real failure
Break one unit test with a genuine assertion change (not a syntax error). Push and show the pipeline halting: downstream stages skipped, the rejection named in the run record.
Step 3
Repair and show green
Fix the test, rerun, and show the full path green with the package step emitting an artifact stamped with commit plus digest. Keep both run records.
How to confirm it worked
- Stage durations recorded with cheap checks first
- Failing run shows downstream stages skipped and names the rejecting stage
- Fixed run is fully green with a stamped artifact recorded
- Both run records kept as evidence