51 / 87 · 02 AI-Augmented Test Design · Quality Gates for AI-Generated Test Suites← prev⊞ allnext →☰ Read as one page
8.4Integrating Gates into CI
# .github/workflows/test-quality-gates.yml
name: Test Quality Gates
on: [pull_request]
jobs:
quality-gates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install -r requirements-test.txt
- name: "Gate 1: All tests pass"
run: pytest tests/ -v --tb=short
- name: "Gate 2: No assertion-free tests"
run: python scripts/check_assertions.py tests/
- name: "Gate 3: Coverage threshold"
run: pytest --cov=app --cov-fail-under=80 --cov-report=xml
- name: "Gate 4: Flaky test detection"
run: pytest tests/ --count=3 -x
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
file: coverage.xml