Repository: tensorzero/tensorzero (language: rust)

Issue:
Rename the UI's fixture database to a non-default name
To avoid #874...


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml
index 51efe587e..6acdc0f81 100644
--- a/.github/workflows/general.yml
+++ b/.github/workflows/general.yml
@@ -115,16 +115,16 @@ jobs:
       - name: pnpm TypeScript type checking
         working-directory: ui
         run: pnpm run typecheck
-      
+
       - name: Start services for ui tests
         working-directory: ui
         run: |
           echo "OPENAI_API_KEY=not_used" >> .env
           echo "FIREWORKS_API_KEY=not_used" >> .env
           echo "FIREWORKS_ACCOUNT_ID=not_used" >> .env
-          echo "TENSORZERO_CLICKHOUSE_URL=http://localhost:8123/tensorzero" >> .env
+          echo "TENSORZERO_CLICKHOUSE_URL=http://localhost:8123/ui_fixtures" >> .env
           docker compose -f fixtures/docker-compose.yml up -d --build
 
       - name: Run ui tests
         working-directory: ui
-        run: pnpm test
+        run: TENSORZERO_CLICKHOUSE_URL=http://localhost:8123/ui_fixtures pnpm test
diff --git a/.github/workflows/merge-queue.yml b/.github/workflows/merge-queue.yml
index 5ff26d056..02f7fd6ca 100644
--- a/.github/workflows/merge-queue.yml
+++ b/.github/workflows/merge-queue.yml
@@ -92,7 +92,7 @@ jobs:
 
       - name: Wake up ClickHouse cloud (for batch tests)
         run: |
-          curl ${{ secrets.CLICKHOUSE_CLOUD_URL }}/ping &
+          curl ${{ secrets.CLICKHOUSE_CLOUD_URL }} --data-binary 'SHOW DATABASES' > clickhouse_wakeup_logs.txt &
 
       - name: Run all tests (including E2E tests)
         run: |
@@ -243,22 +243,27 @@ jobs:
           echo "OPENAI_API_KEY=not_used" >> .env
           echo "FIREWORKS_API_KEY=not_used" >> .env
           echo "FIREWORKS_ACCOUNT_ID=not_used" >> .env
-          echo "TENSORZERO_CLICKHOUSE_URL=http://localhost:8123/tensorzero" >> .env
+          echo "TENSORZERO_CLICKHOUSE_URL=http://localhost:8123/ui_fixtures" >> .env
           docker compose -f fixtures/docker-compose.yml up -d --build
 
       - name: Run ui tests
         working-directory: ui
-        run: pnpm test
+        run: TENSORZERO_CLICKHOUSE_URL=http://localhost:8123/ui_fixtures pnpm test
 
       - name: Take down ui tests
         working-directory: ui
         run: docker compose -f fixtures/docker-compose.yml down
 
+      - name: Print clickhouse wakeup logs
+        if: always()
+        run: cat clickhouse_wakeup_logs.txt
+
       - name: Set up TENSORZERO_CLICKHOUSE_URL for batch tests
         run: |
           echo "TENSORZERO_CLICKHOUSE_URL=${{ secrets.CLICKHOUSE_CLOUD_URL }}" >> $GITHUB_ENV
       - name: Launch the gateway for batch tests
         run: |
+          curl ${{ secrets.CLICKHOUSE_CLOUD_URL }} --data-binary 'SHOW DATABASES'
           cargo run-e2e &
           echo "GATEWAY_PID=$!" >> $GITHUB_ENV
           while ! curl -s -f http://localhost:3000/health >/dev/null 2>&1; do
diff --git a/ui/fixtures/docker-compose.yml b/ui/fixtures/docker-compose.yml
index c3beb8db8..c219728bc 100644
--- a/ui/fixtures/docker-compose.yml
+++ b/ui/fixtures/docker-compose.yml
@@ -35,7 +35,7 @@ services:
     volumes:
       - ./config:/app/config:ro
     environment:
-      - TENSORZERO_CLICKHOUSE_URL=http://tensorzero-clickhouse-ui-tests:8123/tensorzero
+      - TENSORZERO_CLICKHOUSE_URL=http://tensorzero-clickhouse-ui-tests:8123/ui_fixtures
     env_file:
       - ${ENV_FILE:-../.env}
     ports:
diff --git a/ui/fixtures/load_fixtures.sh b/ui/fixtures/load_fixtures.sh
index 9f41cc68a..b3d5752e5 100755
--- a/ui/fixtures/load_fixtures.sh
+++ b/ui/fixtures/load_fixtures.sh
@@ -1,10 +1,10 @@
 #!/bin/bash
 set -e
-clickhouse-client --host $CLICKHOUSE_HOST --database tensorzero --query "INSERT INTO JsonInference FORMAT CSV" < json_inference_examples.csv
-clickhouse-client --host $CLICKHOUSE_HOST --database tensorzero --query "INSERT INTO BooleanMetricFeedback FORMAT CSV" < boolean_metric_feedback_examples.csv
-clickhouse-client --host $CLICKHOUSE_HOST --database tensorzero --query "INSERT INTO FloatMetricFeedback FORMAT CSV" < float_metric_feedback_examples.csv
-clickhouse-client --host $CLICKHOUSE_HOST --database tensorzero --query "INSERT INTO CommentFeedback FORMAT CSV" < comment_feedback_examples.csv
-clickhouse-client --host $CLICKHOUSE_HOST --database tensorzero --query "INSERT INTO DemonstrationFeedback FORMAT CSV" < demonstration_feedback_examples.csv
-clickhouse-client --host $CLICKHOUSE_HOST --database tensorzero --query "INSERT INTO ChatInference FORMAT CSV" < chat_inference_examples.csv
-clickhouse-client --host $CLICKHOUSE_HOST --database tensorzero --query "INSERT INTO ModelInference FORMAT CSV" < model_inference_examples.csv
+clickhouse-client --host $CLICKHOUSE_HOST --database ui_fixtures --query "INSERT INTO JsonInference FORMAT CSV" < json_inference_examples.csv
+clickhouse-client --host $CLICKHOUSE_HOST --database ui_fixtures --query "INSERT INTO BooleanMetricFeedback FORMAT CSV" < boolean_metric_feedback_examples.csv
+clickhouse-client --host $CLICKHOUSE_HOST --database ui_fixtures --query "INSERT INTO FloatMetricFeedback FORMAT CSV" < float_metric_feedback_examples.csv
+clickhouse-client --host $CLICKHOUSE_HOST --database ui_fixtures --query "INSERT INTO CommentFeedback FORMAT CSV" < comment_feedback_examples.csv
+clickhouse-client --host $CLICKHOUSE_HOST --database ui_fixtures --query "INSERT INTO DemonstrationFeedback FORMAT CSV" < demonstration_feedback_examples.csv
+clickhouse-client --host $CLICKHOUSE_HOST --database ui_fixtures --query "INSERT INTO ChatInference FORMAT CSV" < chat_inference_examples.csv
+clickhouse-client --host $CLICKHOUSE_HOST --database ui_fixtures --query "INSERT INTO ModelInference FORMAT CSV" < model_inference_examples.csv
 echo "Fixtures loaded; this container will now exit with status 0"


Test patch: