Modern QA2026Putting It All Together: Debug Workflow — tiles
Log inJoin
54 / 55 · 19 Linux & Command Line · Logs and Environment Variables← prev⊞ allnext →☰ Read as one page

7.6Putting It All Together: Debug Workflow

When a test fails in CI, here is a systematic approach using command-line tools:

# Step 1: Check what changed (what could have caused the failure?)
git log --oneline -5 --stat

# Step 2: Check the test results
cat test-results/junit.xml | grep 'failure message'

# Step 3: Check application logs for errors around the test execution time
grep -A 5 "ERROR" /var/log/app/application.log | tail -30

# Step 4: Check system resources (was the runner overloaded?)
free -h
df -h
uptime

# Step 5: Check service health
curl -s -o /dev/null -w "%{http_code}" https://staging.example.com/health

# Step 6: Check container status (if using Docker)
docker ps -a
docker logs test-app --tail 50

# Step 7: Check environment variables (is the right config loaded?)
env | grep -i "base_url\|api_key\|db_"

# Step 8: Reproduce locally
export $(grep -v '^#' .env.staging | xargs)
npx playwright test tests/failing-test.spec.ts --headed