Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(ci): keep coverage rename green when a parallel node runs no tests (#29608)

Mateo Wang84969aaf15fa
diff --git a/.circleci/config.yml b/.circleci/config.yml
index f5a8fe77a25..6ee5634f54f 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -249,8 +249,15 @@ jobs:
- run:
name: Rename the coverage files
command: |
- mv coverage.xml local_testing_part1_coverage.xml
- mv .coverage local_testing_part1_coverage
+ # When CI reruns only the failed tests, a parallel node can receive
+ # zero tests and pytest never writes coverage. Emit empty placeholders
+ # so persist_to_workspace and the downstream coverage combine stay green.
+ if [ -f coverage.xml ]; then
+ mv coverage.xml local_testing_part1_coverage.xml
+ mv .coverage local_testing_part1_coverage
+ else
+ touch local_testing_part1_coverage.xml local_testing_part1_coverage
+ fi
# Store test results
- store_test_results:
@@ -314,8 +321,15 @@ jobs:
- run:
name: Rename the coverage files
command: |
- mv coverage.xml local_testing_part2_coverage.xml
- mv .coverage local_testing_part2_coverage
+ # When CI reruns only the failed tests, a parallel node can receive
+ # zero tests and pytest never writes coverage. Emit empty placeholders
+ # so persist_to_workspace and the downstream coverage combine stay green.
+ if [ -f coverage.xml ]; then
+ mv coverage.xml local_testing_part2_coverage.xml
+ mv .coverage local_testing_part2_coverage
+ else
+ touch local_testing_part2_coverage.xml local_testing_part2_coverage
+ fi
# Store test results
- store_test_results:
@@ -464,6 +478,11 @@ jobs:
- run:
name: Run tests
command: |
+ # On a "rerun failed tests" build a parallel node can receive no
+ # tests, so the test command never creates test-results. Pre-create it
+ # so store_test_results doesn't fail the node on a missing path.
+ mkdir -p test-results
+
TEST_FILES=$(circleci tests glob "tests/local_testing/**/test_*.py")
echo "$TEST_FILES" | circleci tests run \
diff --git a/tests/test_openai_endpoints.py b/tests/test_openai_endpoints.py
index e898b88a556..880cc1ebbef 100644
--- a/tests/test_openai_endpoints.py
+++ b/tests/test_openai_endpoints.py
@@ -522,6 +522,7 @@ async def test_image_generation():
await image_generation(session=session, key=key_2)
[email protected](retries=5, delay=1)
@pytest.mark.asyncio
async def test_openai_wildcard_chat_completion():
"""