diff --git a/.circleci/config.yml b/.circleci/config.yml index 1dba9086027..8cfeba5c5e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2407,6 +2407,95 @@ jobs: paths: - claude-code-client.tar.zst + build_claude_code_client_image_pinned: + machine: + image: ubuntu-2204:2024.04.1 + resource_class: medium + working_directory: ~/project + steps: + - checkout + - run: + name: Build pinned Claude Code client image + command: | + docker build \ + --build-arg CLAUDE_CODE_VERSION=2.1.100 \ + -t claude-code-client-pinned:ci \ + -f tests/proxy_e2e_anthropic_messages_tests/claude_code/Dockerfile.claude-code \ + tests/proxy_e2e_anthropic_messages_tests/claude_code + - run: + name: Save pinned Claude Code image to workspace root + command: | + docker save claude-code-client-pinned:ci | zstd -1 -T0 > claude-code-client-pinned.tar.zst + - persist_to_workspace: + root: . + paths: + - claude-code-client-pinned.tar.zst + + proxy_e2e_claude_code_pinned_version_tests: + machine: + image: ubuntu-2204:2024.04.1 + resource_class: large + working_directory: ~/project + steps: + - checkout + - setup_google_dns + - attach_workspace: + at: ~/project + - run: + name: Load Docker Database Image + command: | + zstd -d litellm-docker-database.tar.zst --stdout | docker load + docker images | grep litellm-docker-database + - run: + name: Load pinned Claude Code client image + command: | + zstd -d claude-code-client-pinned.tar.zst --stdout | docker load + docker images | grep claude-code-client-pinned + - run: + name: Verify required container images stage + command: | + docker image inspect litellm-docker-database:ci >/dev/null + docker image inspect claude-code-client-pinned:ci >/dev/null + echo "LiteLLM and pinned Claude Code images are ready" + - run: + name: Run Dockerized Claude Code pinned-version E2E Tests + command: | + mkdir -p test-results + : "${LITELLM_MASTER_KEY:?Set LITELLM_MASTER_KEY in CircleCI project env vars.}" + : "${ANTHROPIC_API_KEY:?Set ANTHROPIC_API_KEY in CircleCI project env vars.}" + set +e + LITELLM_IMAGE=litellm-docker-database:ci \ + CLAUDE_CODE_IMAGE=claude-code-client-pinned:ci \ + UPSTREAM_PROVIDER=anthropic \ + LITELLM_SKIP_BUILD=true \ + CLAUDE_CODE_SKIP_BUILD=true \ + LITELLM_MASTER_KEY="${LITELLM_MASTER_KEY}" \ + tests/proxy_e2e_anthropic_messages_tests/claude_code/run_claude_code_docker_test.sh + status=$? + if [ "$status" -eq 0 ]; then + printf '%s\n' \ + '' \ + '' \ + ' ' \ + '' \ + > test-results/junit.xml + else + printf '%s\n' \ + '' \ + '' \ + ' ' \ + ' See CircleCI job output for Docker and LiteLLM logs.' \ + ' ' \ + '' \ + > test-results/junit.xml + fi + exit "$status" + no_output_timeout: 15m + + # Store test results + - store_test_results: + path: test-results + test_bad_database_url: machine: @@ -2482,6 +2571,8 @@ workflows: filters: *main_branches - build_claude_code_client_image: filters: *main_branches + - build_claude_code_client_image_pinned: + filters: *main_branches - e2e_ui_testing: filters: *main_branches - build_and_test: @@ -2523,6 +2614,11 @@ workflows: - build_docker_database_image - build_claude_code_client_image filters: *main_branches + - proxy_e2e_claude_code_pinned_version_tests: + requires: + - build_docker_database_image + - build_claude_code_client_image_pinned + filters: *main_branches - proxy_e2e_claude_code_bedrock_tests: requires: - build_docker_database_image