-
Notifications
You must be signed in to change notification settings - Fork 40
143 lines (124 loc) · 4.2 KB
/
Copy pathpull_request.yml
File metadata and controls
143 lines (124 loc) · 4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Continuous Integration
on:
push:
branches:
- main
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'