ci(e2e): stabilize preference demo test execution (#865)

This commit is contained in:
Musa 2026-04-02 21:32:20 -04:00 committed by GitHub
parent 7606c55b4b
commit aa16a6dc4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 3 deletions

View file

@ -477,7 +477,7 @@ jobs:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: | run: |
source venv/bin/activate source venv/bin/activate
cd demos/shared/test_runner && sh run_demo_tests.sh llm_routing/preference_based_routing cd demos/shared/test_runner && bash run_demo_tests.sh llm_routing/preference_based_routing
# ────────────────────────────────────────────── # ──────────────────────────────────────────────
# E2E: demo — currency conversion # E2E: demo — currency conversion
@ -527,4 +527,4 @@ jobs:
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
run: | run: |
source venv/bin/activate source venv/bin/activate
cd demos/shared/test_runner && sh run_demo_tests.sh advanced/currency_exchange cd demos/shared/test_runner && bash run_demo_tests.sh advanced/currency_exchange

View file

@ -14,6 +14,30 @@ DEMOS="$@"
echo "Running tests for demos: $DEMOS" echo "Running tests for demos: $DEMOS"
run_hurl_with_retries() {
local demo_name="$1"
local max_attempts=1
local attempt=1
if [ "$demo_name" = "llm_routing/preference_based_routing" ]; then
max_attempts=3
fi
while true; do
if hurl hurl_tests/*.hurl; then
return 0
fi
if [ "$attempt" -ge "$max_attempts" ]; then
return 1
fi
attempt=$((attempt + 1))
echo "hurl failed for $demo_name, retrying (attempt $attempt/$max_attempts) ..."
sleep 2
done
}
for demo in $DEMOS for demo in $DEMOS
do do
echo "******************************************" echo "******************************************"
@ -31,7 +55,7 @@ do
echo "skipping docker compose for $demo" echo "skipping docker compose for $demo"
fi fi
echo "starting hurl tests" echo "starting hurl tests"
if ! hurl hurl_tests/*.hurl; then if ! run_hurl_with_retries "$demo"; then
echo "Hurl tests failed for $demo" echo "Hurl tests failed for $demo"
echo "docker logs for plano:" echo "docker logs for plano:"
docker logs plano | tail -n 100 docker logs plano | tail -n 100