Skip to content

Commit d3b29b6

Browse files
committed
(fix) ci/cd local testing
1 parent 4f5222a commit d3b29b6

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

.circleci/config.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,94 @@
11
version: 2.1
22
jobs:
3+
local_testing:
4+
docker:
5+
- image: circleci/python:3.9
6+
working_directory: ~/project
7+
8+
steps:
9+
- checkout
10+
11+
- run:
12+
name: Check if litellm dir was updated or if pyproject.toml was modified
13+
command: |
14+
if [ -n "$(git diff --name-only $CIRCLE_SHA1^..$CIRCLE_SHA1 | grep -E 'pyproject\.toml|litellm/')" ]; then
15+
echo "litellm updated"
16+
else
17+
echo "No changes to litellm or pyproject.toml. Skipping tests."
18+
circleci step halt
19+
fi
20+
- restore_cache:
21+
keys:
22+
- v1-dependencies-{{ checksum ".circleci/requirements.txt" }}
23+
- run:
24+
name: Install Dependencies
25+
command: |
26+
python -m pip install --upgrade pip
27+
python -m pip install -r .circleci/requirements.txt
28+
pip install "pytest==7.3.1"
29+
pip install "pytest-asyncio==0.21.1"
30+
pip install mypy
31+
pip install "google-generativeai>=0.3.2"
32+
pip install "google-cloud-aiplatform>=1.38.0"
33+
pip install "boto3>=1.28.57"
34+
pip install "aioboto3>=12.3.0"
35+
pip install langchain
36+
pip install "langfuse>=2.0.0"
37+
pip install numpydoc
38+
pip install traceloop-sdk==0.0.69
39+
pip install openai
40+
pip install prisma
41+
pip install "httpx==0.24.1"
42+
pip install "gunicorn==21.2.0"
43+
pip install "anyio==3.7.1"
44+
pip install "aiodynamo==23.10.1"
45+
pip install "asyncio==3.4.3"
46+
pip install "apscheduler==3.10.4"
47+
pip install "PyGithub==1.59.1"
48+
pip install python-multipart
49+
- save_cache:
50+
paths:
51+
- ./venv
52+
key: v1-dependencies-{{ checksum ".circleci/requirements.txt" }}
53+
- run:
54+
name: Run prisma ./entrypoint.sh
55+
command: |
56+
set +e
57+
chmod +x entrypoint.sh
58+
./entrypoint.sh
59+
set -e
60+
- run:
61+
name: Black Formatting
62+
command: |
63+
cd litellm
64+
python -m pip install black
65+
python -m black .
66+
cd ..
67+
- run:
68+
name: Linting Testing
69+
command: |
70+
cd litellm
71+
python -m pip install types-requests types-setuptools types-redis
72+
if ! python -m mypy . --ignore-missing-imports; then
73+
echo "mypy detected errors"
74+
exit 1
75+
fi
76+
cd ..
77+
78+
79+
# Run pytest and generate JUnit XML report
80+
- run:
81+
name: Run tests
82+
command: |
83+
pwd
84+
ls
85+
python -m pytest -vv litellm/tests/ -x --junitxml=test-results/junit.xml --durations=5
86+
no_output_timeout: 120m
87+
88+
# Store test results
89+
- store_test_results:
90+
path: test-results
91+
392
installing_litellm_on_python:
493
docker:
594
- image: circleci/python:3.8
@@ -202,6 +291,12 @@ workflows:
202291
version: 2
203292
build_and_test:
204293
jobs:
294+
- local_testing:
295+
filters:
296+
branches:
297+
only:
298+
- main
299+
- /litellm_.*/
205300
- build_and_test:
206301
filters:
207302
branches:

0 commit comments

Comments
 (0)