fix: real time syncs coming soon #1203
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Public API Test | |
on: | |
pull_request_target: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
test-public-api: | |
runs-on: ubuntu-latest | |
environment: dev | |
steps: | |
- name: Verify prerequisites | |
run: | | |
echo "Docker version:" | |
docker --version | |
echo "Docker Compose version:" | |
docker compose version | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
cd backend | |
pip install -r tests/e2e/requirements.txt | |
- name: Setup Docker layer caching | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-docker-${{ hashFiles('docker/docker-compose.yml') }} | |
restore-keys: | | |
${{ runner.os }}-docker- | |
- name: Pre-pull heavy Docker images | |
run: | | |
echo "Pre-pulling Docker images in parallel..." | |
echo "Note: text2vec-transformers disabled via docker-compose profile (backend uses OpenAI)" | |
docker pull postgres:16 & | |
docker pull redis:7-alpine & | |
docker pull qdrant/qdrant:latest & | |
docker pull temporalio/auto-setup:1.24.2 & | |
docker pull temporalio/ui:2.26.2 & | |
wait | |
echo "All images pre-pulled successfully" | |
- name: Build test backend image locally | |
run: | | |
echo "Building backend image for testing..." | |
docker build -t test-backend:latest ./backend | |
- name: Setup environment and start services | |
env: | |
BACKEND_IMAGE: test-backend:latest | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }} | |
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY || 'dummy-key' }} | |
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY || 'dummy-key' }} | |
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY || 'dummy-key' }} | |
CEREBRAS_API_KEY: ${{ secrets.CEREBRAS_API_KEY || 'dummy-key' }} | |
# Required for start.sh to skip interactive prompts | |
NONINTERACTIVE: "1" | |
# Skip services not needed for backend API tests | |
SKIP_LOCAL_EMBEDDINGS: "1" # Use OpenAI embeddings (saves ~2GB) | |
SKIP_FRONTEND: "1" # Backend-only testing (saves time) | |
# Set required environment variables for the containers | |
AUTH0_ENABLED: "false" | |
DEV_MODE: "true" | |
run: | | |
# Create .env from example | |
cp .env.example .env | |
# Add AI keys to .env before starting services | |
echo "OPENAI_API_KEY=$OPENAI_API_KEY" >> .env | |
echo "STRIPE_API_KEY=$STRIPE_API_KEY" >> .env | |
echo "MISTRAL_API_KEY=$MISTRAL_API_KEY" >> .env | |
echo "COHERE_API_KEY=$COHERE_API_KEY" >> .env | |
echo "GROQ_API_KEY=$GROQ_API_KEY" >> .env | |
echo "CEREBRAS_API_KEY=$CEREBRAS_API_KEY" >> .env | |
# Disable rate limiting for regular tests | |
echo "DISABLE_RATE_LIMIT=true" >> .env | |
echo "Starting services using start.sh..." | |
./start.sh --noninteractive | |
# The script already does health checks, but let's verify | |
echo "" | |
echo "Verifying we're using the correct test images:" | |
docker ps --format "table {{.Names}}\t{{.Image}}" | grep airweave | |
echo "" | |
echo "Final verification of services:" | |
docker ps | |
# Backend runs on port 8001 according to start.sh | |
echo "Testing backend on port 8001..." | |
curl -f http://localhost:8001/health || (echo "Backend not healthy"; docker logs airweave-backend; exit 1) | |
echo "Backend is healthy and ready for API tests!" | |
- name: Run E2E Smoke Tests | |
env: | |
TEST_ENV: local | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
TEST_STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }} | |
# Required test environment variables | |
TEST_NOTION_TOKEN: ${{ secrets.TEST_NOTION_TOKEN }} | |
TEST_GOOGLE_CLIENT_ID: ${{ secrets.TEST_GOOGLE_CLIENT_ID }} | |
TEST_GOOGLE_CLIENT_SECRET: ${{ secrets.TEST_GOOGLE_CLIENT_SECRET }} | |
# OAuth1 (Trello) credentials | |
TEST_TRELLO_CONSUMER_KEY: ${{ secrets.TEST_TRELLO_CONSUMER_KEY }} | |
TEST_TRELLO_CONSUMER_SECRET: ${{ secrets.TEST_TRELLO_CONSUMER_SECRET }} | |
TEST_AUTH_PROVIDER_NAME: composio | |
TEST_COMPOSIO_API_KEY: ${{ secrets.TEST_COMPOSIO_API_KEY }} | |
# Composio service-specific configurations | |
TEST_COMPOSIO_TODOIST_AUTH_CONFIG_ID: ac_wcspYMD22UDD | |
TEST_COMPOSIO_TODOIST_ACCOUNT_ID: ca_h1xDM7cdVzeI | |
TEST_COMPOSIO_ASANA_AUTH_CONFIG_ID: ac_hBi29B_-iU3B | |
TEST_COMPOSIO_ASANA_ACCOUNT_ID: ca_ooqwRcKOwHmo | |
TEST_COMPOSIO_GMAIL_AUTH_CONFIG_ID: ac_HocwjtTv-dqb | |
TEST_COMPOSIO_GMAIL_ACCOUNT_ID: ca_jEA4l17nSPzN | |
# Pipedream configurations | |
TEST_PIPEDREAM_CLIENT_ID: ${{ secrets.TEST_PIPEDREAM_CLIENT_ID }} | |
TEST_PIPEDREAM_CLIENT_SECRET: ${{ secrets.TEST_PIPEDREAM_CLIENT_SECRET }} | |
TEST_PIPEDREAM_PROJECT_ID: ${{ secrets.TEST_PIPEDREAM_PROJECT_ID }} | |
TEST_PIPEDREAM_ACCOUNT_ID: ${{ secrets.TEST_PIPEDREAM_ACCOUNT_ID }} | |
TEST_PIPEDREAM_EXTERNAL_USER_ID: ${{ secrets.TEST_PIPEDREAM_EXTERNAL_USER_ID }} | |
# Override images to use locally built test images | |
BACKEND_IMAGE: test-backend:latest | |
run: | | |
cd backend | |
# Exclude rate_limit tests from CI/CD - they consume quota and should run separately | |
# To run rate limit tests locally: pytest tests/e2e/smoke -m rate_limit | |
pytest tests/e2e/smoke -m "not rate_limit" -n 3 -v --tb=short | |
- name: Cleanup Docker containers | |
if: always() | |
run: | | |
echo "Cleaning up Docker containers..." | |
docker compose down -v || true | |
docker system prune -f || true |