87 / 89 · 04 API & Contract Testing with AI · Living API Documentation← prev⊞ allnext →☰ Read as one page
13.4Running the Full Strategy in CI
# .github/workflows/api-testing.yml
name: API Test Strategy
on:
pull_request:
paths: ['app/**', 'docs/openapi.yaml']
jobs:
contract-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm run pact:test
- run: npm run pact:publish
schema-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python -m pytest tests/api/ -v
functional-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker-compose up -d
- run: python -m pytest tests/functional/ -v --cov=app
# Nightly only
semantic-fuzzing:
if: github.event.schedule
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker-compose up -d
- run: python -m api_fuzzer --output fuzz-report.json
# Nightly only
drift-detection:
if: github.event.schedule
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker-compose up -d
- run: python -m schema_drift_detector --output drift-report.json