chore: bump pipecat version and fix tests (#263)

* chore: bump pipecat version and fix tests

* chore: add github workflow to run tests

* fix: install reqirements.dev.txt in test script

* fix: fix api-test action

* feat: add integration test

* test: add integration tests

* test: add test for function call mute strategy
This commit is contained in:
Abhishek 2026-05-04 21:35:37 +05:30 committed by GitHub
parent d256c6005c
commit 0e12c41fc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 1776 additions and 670 deletions

104
.github/workflows/api-tests.yml vendored Normal file
View file

@ -0,0 +1,104 @@
name: API tests
on:
pull_request:
branches: [main]
paths:
- "api/**"
- "pipecat/**"
- "scripts/**"
- ".github/workflows/api-tests.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
# pgvector image: api/alembic/versions/dc33eef8dabe_add_document_tables.py
# runs CREATE EXTENSION vector, which plain postgres doesn't ship.
image: pgvector/pgvector:pg17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# api/conftest.py creates test_db via the postgres admin DB.
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/test_db
REDIS_URL: redis://localhost:6379/0
ENABLE_AWS_S3: "false"
# MINIO is not actually contacted by tests, but storage.py constructs
# the MinioFileSystem at import time and requires MINIO_PUBLIC_ENDPOINT.
MINIO_PUBLIC_ENDPOINT: http://localhost:9000
DEPLOYMENT_MODE: oss
ENVIRONMENT: test
LOG_LEVEL: DEBUG
PYTHONPATH: ${{ github.workspace }}
steps:
- name: Checkout repo (with pipecat submodule)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
api/requirements.txt
pipecat/pyproject.toml
- name: Set up Node 22 (test_ts_bridge.py shells out to node)
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install api dependencies
run: |
pip install -r api/requirements.txt
pip install -r api/requirements.dev.txt
pip install './pipecat[cartesia,deepgram,openai,elevenlabs,groq,google,azure,sarvam,soundfile,silero,webrtc,speechmatics,openrouter,camb]'
- name: Install ts_validator npm deps
working-directory: api/mcp_server/ts_validator
run: npm install
- name: Run pytest
working-directory: api
run: pytest tests/ -xvs
- name: Send Slack notification - Failure
if: failure()
uses: slackapi/slack-github-action@v1.26.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
payload: |
{
"text": "❌ Dograh API tests failed on ${{ github.ref_name }} by ${{ github.actor }} - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Logs>"
}

View file

@ -43,6 +43,7 @@ jobs:
DATABASE_URL: postgresql+asyncpg://dummy:dummy@localhost/dummy
REDIS_URL: redis://localhost:6379/0
ENABLE_AWS_S3: "false"
MINIO_PUBLIC_ENDPOINT: http://localhost:9000
DEPLOYMENT_MODE: oss
run: python -u -m scripts.dump_docs_openapi
@ -54,3 +55,14 @@ jobs:
exit 1
fi
echo "OpenAPI spec is in sync."
- name: Send Slack notification - Failure
if: failure()
uses: slackapi/slack-github-action@v1.26.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
payload: |
{
"text": "❌ Dograh Docs OpenAPI drift check failed on ${{ github.ref_name }} by ${{ github.actor }} - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Logs>"
}