@@ -1450,7 +1450,7 @@ jobs:
1450
1450
command : |
1451
1451
pwd
1452
1452
ls
1453
- python -m pytest -s -vv tests/*.py -x --junitxml=test-results/junit.xml --durations=5 --ignore=tests/otel_tests --ignore=tests/pass_through_tests --ignore=tests/proxy_admin_ui_tests --ignore=tests/load_tests --ignore=tests/llm_translation --ignore=tests/llm_responses_api_testing --ignore=tests/mcp_tests --ignore=tests/image_gen_tests --ignore=tests/pass_through_unit_tests
1453
+ python -m pytest -s -vv tests/*.py -x --junitxml=test-results/junit.xml --durations=5 --ignore=tests/otel_tests --ignore=tests/spend_tracking_tests --ignore=tests/ pass_through_tests --ignore=tests/proxy_admin_ui_tests --ignore=tests/load_tests --ignore=tests/llm_translation --ignore=tests/llm_responses_api_testing --ignore=tests/mcp_tests --ignore=tests/image_gen_tests --ignore=tests/pass_through_unit_tests
1454
1454
no_output_timeout : 120m
1455
1455
1456
1456
# Store test results
@@ -1743,6 +1743,96 @@ jobs:
1743
1743
# Store test results
1744
1744
- store_test_results :
1745
1745
path : test-results
1746
+ proxy_spend_accuracy_tests :
1747
+ machine :
1748
+ image : ubuntu-2204:2023.10.1
1749
+ resource_class : xlarge
1750
+ working_directory : ~/project
1751
+ steps :
1752
+ - checkout
1753
+ - setup_google_dns
1754
+ - run :
1755
+ name : Install Docker CLI (In case it's not already installed)
1756
+ command : |
1757
+ sudo apt-get update
1758
+ sudo apt-get install -y docker-ce docker-ce-cli containerd.io
1759
+ - run :
1760
+ name : Install Python 3.9
1761
+ command : |
1762
+ curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh --output miniconda.sh
1763
+ bash miniconda.sh -b -p $HOME/miniconda
1764
+ export PATH="$HOME/miniconda/bin:$PATH"
1765
+ conda init bash
1766
+ source ~/.bashrc
1767
+ conda create -n myenv python=3.9 -y
1768
+ conda activate myenv
1769
+ python --version
1770
+ - run :
1771
+ name : Install Dependencies
1772
+ command : |
1773
+ pip install "pytest==7.3.1"
1774
+ pip install "pytest-asyncio==0.21.1"
1775
+ pip install aiohttp
1776
+ python -m pip install --upgrade pip
1777
+ python -m pip install -r requirements.txt
1778
+ - run :
1779
+ name : Build Docker image
1780
+ command : docker build -t my-app:latest -f ./docker/Dockerfile.database .
1781
+ - run :
1782
+ name : Run Docker container
1783
+ # intentionally give bad redis credentials here
1784
+ # the OTEL test - should get this as a trace
1785
+ command : |
1786
+ docker run -d \
1787
+ -p 4000:4000 \
1788
+ -e DATABASE_URL=$PROXY_DATABASE_URL \
1789
+ -e REDIS_HOST=$REDIS_HOST \
1790
+ -e REDIS_PASSWORD=$REDIS_PASSWORD \
1791
+ -e REDIS_PORT=$REDIS_PORT \
1792
+ -e LITELLM_MASTER_KEY="sk-1234" \
1793
+ -e OPENAI_API_KEY=$OPENAI_API_KEY \
1794
+ -e LITELLM_LICENSE=$LITELLM_LICENSE \
1795
+ -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
1796
+ -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
1797
+ -e USE_DDTRACE=True \
1798
+ -e DD_API_KEY=$DD_API_KEY \
1799
+ -e DD_SITE=$DD_SITE \
1800
+ -e AWS_REGION_NAME=$AWS_REGION_NAME \
1801
+ --name my-app \
1802
+ -v $(pwd)/litellm/proxy/example_config_yaml/spend_tracking_config.yaml:/app/config.yaml \
1803
+ my-app:latest \
1804
+ --config /app/config.yaml \
1805
+ --port 4000 \
1806
+ --detailed_debug \
1807
+ - run :
1808
+ name : Install curl and dockerize
1809
+ command : |
1810
+ sudo apt-get update
1811
+ sudo apt-get install -y curl
1812
+ sudo wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz
1813
+ sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz
1814
+ sudo rm dockerize-linux-amd64-v0.6.1.tar.gz
1815
+ - run :
1816
+ name : Start outputting logs
1817
+ command : docker logs -f my-app
1818
+ background : true
1819
+ - run :
1820
+ name : Wait for app to be ready
1821
+ command : dockerize -wait http://localhost:4000 -timeout 5m
1822
+ - run :
1823
+ name : Run tests
1824
+ command : |
1825
+ pwd
1826
+ ls
1827
+ python -m pytest -vv tests/spend_tracking_tests -x --junitxml=test-results/junit.xml --durations=5
1828
+ no_output_timeout :
1829
+ 120m
1830
+ # Clean up first container
1831
+ - run :
1832
+ name : Stop and remove first container
1833
+ command : |
1834
+ docker stop my-app
1835
+ docker rm my-app
1746
1836
1747
1837
proxy_multi_instance_tests :
1748
1838
machine :
@@ -2553,6 +2643,12 @@ workflows:
2553
2643
only :
2554
2644
- main
2555
2645
- /litellm_.*/
2646
+ - proxy_spend_accuracy_tests :
2647
+ filters :
2648
+ branches :
2649
+ only :
2650
+ - main
2651
+ - /litellm_.*/
2556
2652
- proxy_multi_instance_tests :
2557
2653
filters :
2558
2654
branches :
@@ -2714,6 +2810,7 @@ workflows:
2714
2810
- installing_litellm_on_python
2715
2811
- installing_litellm_on_python_3_13
2716
2812
- proxy_logging_guardrails_model_info_tests
2813
+ - proxy_spend_accuracy_tests
2717
2814
- proxy_multi_instance_tests
2718
2815
- proxy_store_model_in_db_tests
2719
2816
- proxy_build_from_pip_tests
0 commit comments