Benchmark #5
Workflow file for this run
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: Pipeline Tests | |
| on: | |
| push: | |
| branches: [ main, development ] | |
| pull_request: | |
| branches: [ main, development ] | |
| jobs: | |
| test-minimal: | |
| name: Minimal Pipeline Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install -r tests/requirements-minimal.txt | |
| - name: Run minimal pipeline tests (no external services) | |
| run: | | |
| python -m pytest tests/pipeline/test_minimal_pipeline.py tests/pipeline/test_components.py -v --tb=short | |
| - name: Run configuration validation | |
| run: | | |
| python -c " | |
| import yaml | |
| import sys | |
| # Test that all YAML configs are valid | |
| configs = ['config.yml', 'pipelines/configs/retrieval/ci_google_gemini.yml'] | |
| for config in configs: | |
| try: | |
| with open(config) as f: | |
| yaml.safe_load(f) | |
| print(f'✅ {config} is valid') | |
| except Exception as e: | |
| print(f'❌ {config} failed: {e}') | |
| sys.exit(1) | |
| " | |
| test-integration: | |
| name: Integration Tests with Qdrant | |
| runs-on: ubuntu-latest | |
| services: | |
| qdrant: | |
| image: qdrant/qdrant:latest | |
| ports: | |
| - 6333:6333 | |
| options: >- | |
| --health-cmd "curl -f http://localhost:6333/collections || exit 1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install -r tests/requirements-test.txt | |
| - name: Wait for Qdrant to be ready | |
| run: | | |
| timeout 60 bash -c 'until curl -f http://localhost:6333/collections; do sleep 2; done' | |
| echo "Qdrant is ready!" | |
| - name: Test Qdrant connectivity | |
| run: | | |
| python -m pytest tests/pipeline/test_qdrant_connectivity.py -v --tb=short | |
| - name: Run basic integration tests | |
| run: | | |
| python -m pytest tests/pipeline/ -v --tb=short -m "not requires_api" | |
| test-end-to-end: | |
| name: End-to-End Pipeline Tests | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | |
| services: | |
| qdrant: | |
| image: qdrant/qdrant:latest | |
| ports: | |
| - 6333:6333 | |
| options: >- | |
| --health-cmd "curl -f http://localhost:6333/collections || exit 1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install -r tests/requirements-test.txt | |
| - name: Wait for Qdrant to be ready | |
| run: | | |
| timeout 60 bash -c 'until curl -f http://localhost:6333/collections; do sleep 2; done' | |
| echo "Qdrant is ready!" | |
| - name: Test Qdrant health | |
| run: | | |
| curl -f http://localhost:6333/collections | |
| echo "Qdrant collections endpoint working" | |
| - name: Run end-to-end pipeline tests | |
| env: | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| QDRANT_HOST: localhost | |
| QDRANT_PORT: 6333 | |
| run: | | |
| if [ -z "$GOOGLE_API_KEY" ]; then | |
| echo "⚠️ GOOGLE_API_KEY not set - skipping end-to-end tests" | |
| exit 0 | |
| fi | |
| echo "🔑 API key available - running full end-to-end tests" | |
| python -m pytest tests/pipeline/test_end_to_end.py -v --tb=short -m "requires_api" | |
| - name: Run comprehensive test suite | |
| env: | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| QDRANT_HOST: localhost | |
| QDRANT_PORT: 6333 | |
| run: | | |
| if [ -n "$GOOGLE_API_KEY" ]; then | |
| echo "🚀 Running comprehensive test suite with API" | |
| python tests/pipeline/run_tests.py | |
| else | |
| echo "⚠️ Running minimal test suite without API" | |
| python -m pytest tests/pipeline/test_minimal_pipeline.py tests/pipeline/test_components.py -v | |
| fi | |
| test-security: | |
| name: Security and Config Validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check for hardcoded secrets | |
| run: | | |
| # Check that no API keys are hardcoded | |
| if grep -r "sk-" . --exclude-dir=.git --exclude="*.md" --exclude="*.yml"; then | |
| echo "❌ Found potential hardcoded API keys" | |
| exit 1 | |
| fi | |
| if grep -r "google_api_key.*=" . --exclude-dir=.git --exclude="*.md" --exclude="*.yml" | grep -v "getenv\|environ"; then | |
| echo "❌ Found potential hardcoded Google API keys" | |
| exit 1 | |
| fi | |
| echo "✅ No hardcoded secrets found" | |
| - name: Validate configuration structure | |
| run: | | |
| python -c " | |
| import yaml | |
| # Validate CI config structure | |
| with open('pipelines/configs/retrieval/ci_google_gemini.yml') as f: | |
| config = yaml.safe_load(f) | |
| # Check required fields | |
| assert 'retrieval_pipeline' in config | |
| assert 'retriever' in config['retrieval_pipeline'] | |
| assert 'embedding' in config['retrieval_pipeline']['retriever'] | |
| assert 'google' == config['retrieval_pipeline']['retriever']['embedding']['dense']['provider'] | |
| assert 'GOOGLE_API_KEY' == config['retrieval_pipeline']['retriever']['embedding']['dense']['api_key_env'] | |
| print('✅ Configuration structure is valid') | |
| " |