Skip to content

[CCOR-13193] Run Integration(e2e) tests on PR-to-main (phase 1: test with sdkdev v5 server) #1164

[CCOR-13193] Run Integration(e2e) tests on PR-to-main (phase 1: test with sdkdev v5 server)

[CCOR-13193] Run Integration(e2e) tests on PR-to-main (phase 1: test with sdkdev v5 server) #1164

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
# Temporary: run CI on this branch's pushes until it's exercised via a
# real PR targeting main. Remove once that PR validates the workflow.
- integ-test-on-pr
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
unit-test:
runs-on: ubuntu-latest
env:
COVERAGE_DIR: .coverage-reports
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest pytest-cov coverage
- name: Verify agents import without extras installed
id: agent_base_import
continue-on-error: true
run: |
python -c "import conductor.ai.agents"
- name: Install agents extra
run: |
pip install -e '.[agents]'
pip install pytest-asyncio
- name: Prepare coverage directory
run: |
mkdir -p ${{ env.COVERAGE_DIR }}
- name: Run unit tests
id: unit_tests
continue-on-error: true
env:
COVERAGE_FILE: ${{ env.COVERAGE_DIR }}/.coverage.unit
run: |
coverage run -m pytest tests/unit -v
- name: Run backward compatibility tests
id: bc_tests
continue-on-error: true
env:
COVERAGE_FILE: ${{ env.COVERAGE_DIR }}/.coverage.bc
run: |
coverage run -m pytest tests/backwardcompatibility -v
- name: Run serdeser tests
id: serdeser_tests
continue-on-error: true
env:
COVERAGE_FILE: ${{ env.COVERAGE_DIR }}/.coverage.serdeser
run: |
coverage run -m pytest tests/serdesertest -v
- name: Generate coverage report
id: coverage_report
run: |
coverage combine ${{ env.COVERAGE_DIR }}/.coverage.*
coverage report
coverage xml -o coverage.xml
- name: Verify coverage file
id: verify_coverage
if: always()
run: |
if [ ! -s coverage.xml ]; then
echo "coverage.xml is empty or does not exist"
ls -la coverage.xml ${{ env.COVERAGE_DIR }} || true
exit 1
fi
echo "coverage.xml exists and is not empty"
- name: Upload coverage to Codecov
if: always() && steps.verify_coverage.outcome == 'success'
continue-on-error: true
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
- name: Check test results
if: steps.unit_tests.outcome == 'failure' || steps.bc_tests.outcome == 'failure' || steps.serdeser_tests.outcome == 'failure' || steps.agent_base_import.outcome == 'failure'
run: exit 1
integration-test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
bucket: [test-all, long-sync, long-async, core]
name: integration-test (${{ matrix.bucket }})
env:
CONDUCTOR_SERVER_URL: ${{ vars.SDKDEV_V5_SERVER_URL }}
CONDUCTOR_AUTH_KEY: ${{ vars.SDKDEV_V5_AUTH_KEY }}
CONDUCTOR_AUTH_SECRET: ${{ secrets.SDKDEV_V5_AUTH_SECRET }}
# Force HTTP/1.1 for integration tests: long-lived HTTP/2 connections to
# the shared dev server (through its proxy/LB) intermittently stall
# mid-stream, surfacing as httpcore.ReadTimeout -> ApiException(0). HTTP/1.1
# uses one request per pooled connection, avoiding that failure class.
CONDUCTOR_HTTP2_ENABLED: "false"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest
- name: Run integration tests
run: >-
bash scripts/run_integration_tests.sh --bucket=${{ matrix.bucket }}
-s --log-cli-level=INFO
--log-cli-format='%(asctime)s %(levelname)s %(name)s: %(message)s'