This document describes how to test CI failures to ensure the pipeline catches issues correctly.
Create a lint violation:
# In packages/core/src/ai_kit_core/__init__.py
import os # Unused import - should fail ruff checkExpected: CI lint job should fail with ruff error
Cleanup: Remove the unused import
Create a format issue:
# In packages/core/src/ai_kit_core/__init__.py
def hello(name: str = "World") -> str:
return f"Hello, {name}!" # Remove proper spacingExpected: CI format-check job should fail
Cleanup: Run just format to fix
Create a failing test:
# In packages/core/tests/test_core.py
def test_hello_fail():
"""This test should fail."""
assert hello() == "Goodbye, World!" # Wrong expected valueExpected: CI test job should fail
Cleanup: Remove or fix the test
Use undeclared dependency:
# In apps/cli/src/ai_kit_cli/main.py
import requests # Not declared in pyproject.tomlExpected: CI should fail when syncing with strict package isolation
Cleanup: Either add requests to dependencies or remove the import
Create pre-commit violation:
# Make a commit with formatting issues
echo "def bad_format( ):pass" >> packages/core/src/ai_kit_core/temp.py
git add .
git commit -m "test: bad format"Expected: Pre-commit hooks should block the commit locally
Cleanup: Fix formatting or remove the file
# Test lint
pnpm lint
# Test format check
pnpm format
# Test all tests
pnpm test
# Test build
pnpm build# Test core package isolation
uv sync --package ai-kit-core
uv run --package ai-kit-core pytest packages/core/tests/
# Test CLI package isolation
uv sync --package ai-kit-cli
uv run --package ai-kit-cli pytest apps/cli/tests/After pushing changes, verify:
- ✅ All jobs run in parallel (lint, format-check, test)
- ✅ Build job waits for other jobs to complete
- ✅ Turborepo cache is used (check job logs)
- ✅ Strict package isolation catches undeclared dependencies
- ✅ Pre-commit workflow runs on PRs
- ✅ Clear error messages when failures occur
- SC-006: CI completes in <5 minutes for typical PRs
- SC-007: Zero "works on my machine" issues
- SC-008: CI catches undeclared dependencies via strict sync
- FR-020: CI fails fast on lint/format violations
- FR-021: Strict package isolation in ALL jobs