From b9a443e01e3c2ff776c77fa6d468cfa6b80b06f5 Mon Sep 17 00:00:00 2001 From: guenhter Date: Thu, 7 May 2026 06:18:16 +0200 Subject: [PATCH] chore: remove temporary workaround with aimock --- .gitignore | 1 + docs/run.sh | 2 +- e2e_tests/tests_omni_full/playwright.config.ts | 2 +- e2e_tests/tests_omni_full/scripts/run-aimock.sh | 5 ++--- e2e_tests/tests_omni_full/scripts/run-backend.sh | 2 +- .../tests_omni_full/scripts/run-dice-roller.sh | 2 +- e2e_tests/tests_omni_full/scripts/run-frontend.sh | 2 +- e2e_tests/tests_omni_light/playwright.config.ts | 2 +- e2e_tests/tests_omni_light/scripts/run-aimock.sh | 15 ++------------- .../tests_omni_light/scripts/run-frontend.sh | 2 +- 10 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index db3ab548..2fd7da5a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vscode/ +.pnpm-store/ .env diff --git a/docs/run.sh b/docs/run.sh index a50d1fdc..fc07a1e6 100755 --- a/docs/run.sh +++ b/docs/run.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +SCRIPT_DIR=$(dirname "$(realpath "$0")") docker container run --rm \ -p 8080:8080 \ diff --git a/e2e_tests/tests_omni_full/playwright.config.ts b/e2e_tests/tests_omni_full/playwright.config.ts index c6e3e198..abde6829 100644 --- a/e2e_tests/tests_omni_full/playwright.config.ts +++ b/e2e_tests/tests_omni_full/playwright.config.ts @@ -2,7 +2,7 @@ import { defineConfig, devices } from "@playwright/test"; export default defineConfig({ testDir: ".", - testMatch: "*.spec.ts", + testMatch: "src/*.spec.ts", timeout: 60000, fullyParallel: false, forbidOnly: !!process.env.CI, diff --git a/e2e_tests/tests_omni_full/scripts/run-aimock.sh b/e2e_tests/tests_omni_full/scripts/run-aimock.sh index 2d4469f5..2c23358e 100755 --- a/e2e_tests/tests_omni_full/scripts/run-aimock.sh +++ b/e2e_tests/tests_omni_full/scripts/run-aimock.sh @@ -11,6 +11,5 @@ FIXTURES_FILE="$SCRIPT_DIR/../src/aimock-fixtures.json" docker container run --rm --pull always \ -p 4010:4010 \ - -v "$FIXTURES_FILE:/fixtures/aimock-fixtures.json:ro" \ - ghcr.io/copilotkit/aimock:latest \ - --fixtures /fixtures/aimock-fixtures.json --host 0.0.0.0 + -v "$FIXTURES_FILE:/app/fixtures/aimock-fixtures.json:ro" \ + ghcr.io/copilotkit/aimock:latest diff --git a/e2e_tests/tests_omni_full/scripts/run-backend.sh b/e2e_tests/tests_omni_full/scripts/run-backend.sh index ff52e24a..c9aadc54 100755 --- a/e2e_tests/tests_omni_full/scripts/run-backend.sh +++ b/e2e_tests/tests_omni_full/scripts/run-backend.sh @@ -23,4 +23,4 @@ export OIDC_POST_LOGOUT_URI="http://localhost:4173/" export SESSION_SECRET="e2e-test-session-secret-32-chars!!" export CORS_ORIGINS="http://localhost:4173" -exec uv run uvicorn modai.main:app +uv run uvicorn modai.main:app diff --git a/e2e_tests/tests_omni_full/scripts/run-dice-roller.sh b/e2e_tests/tests_omni_full/scripts/run-dice-roller.sh index d842d4be..63f385cd 100755 --- a/e2e_tests/tests_omni_full/scripts/run-dice-roller.sh +++ b/e2e_tests/tests_omni_full/scripts/run-dice-roller.sh @@ -12,4 +12,4 @@ DICE_ROLLER_DIR="$ROOT_DIR/backend/tools/dice-roller" cd "$DICE_ROLLER_DIR" -exec uv run uvicorn main:app --port 8001 +uv run uvicorn main:app --port 8001 diff --git a/e2e_tests/tests_omni_full/scripts/run-frontend.sh b/e2e_tests/tests_omni_full/scripts/run-frontend.sh index 4b88b8a8..2e6f7365 100755 --- a/e2e_tests/tests_omni_full/scripts/run-frontend.sh +++ b/e2e_tests/tests_omni_full/scripts/run-frontend.sh @@ -18,4 +18,4 @@ export VITE_API_URL="http://localhost:8000" ln -sf modules_with_backend.json public/modules.json pnpm build -exec pnpm preview +pnpm preview diff --git a/e2e_tests/tests_omni_light/playwright.config.ts b/e2e_tests/tests_omni_light/playwright.config.ts index 39d8dbbd..12d0bc12 100644 --- a/e2e_tests/tests_omni_light/playwright.config.ts +++ b/e2e_tests/tests_omni_light/playwright.config.ts @@ -2,7 +2,7 @@ import { defineConfig, devices } from "@playwright/test"; export default defineConfig({ testDir: ".", - testMatch: "*.spec.ts", + testMatch: "src/*.spec.ts", timeout: 30000, fullyParallel: false, forbidOnly: !!process.env.CI, diff --git a/e2e_tests/tests_omni_light/scripts/run-aimock.sh b/e2e_tests/tests_omni_light/scripts/run-aimock.sh index 1c89b9f6..1c95f6a0 100755 --- a/e2e_tests/tests_omni_light/scripts/run-aimock.sh +++ b/e2e_tests/tests_omni_light/scripts/run-aimock.sh @@ -3,24 +3,13 @@ # # Lifecycle managed by Playwright's webServer config: # - url: http://localhost:4010/health -# -# WORKAROUND: AIMock's CORS preflight response only allows "Content-Type, Authorization" -# in Access-Control-Allow-Headers. Firefox (unlike Chrome) includes the "user-agent" header -# in preflight requests when the OpenAI SDK sets it, which causes CORS blocks. -# We patch server.js inside the container to use "*" instead. -# Remove this workaround once https://github.com/CopilotKit/aimock/issues/158 is resolved. set -euo pipefail SCRIPT_DIR=$(dirname "$(realpath "$0")") FIXTURES_FILE="$SCRIPT_DIR/../src/aimock-fixtures.json" -docker container rm -f e2e-light-aimock 2>/dev/null || true docker container run --rm --pull always \ - --name e2e-light-aimock \ -p 4010:4010 \ - -v "$FIXTURES_FILE:/fixtures/aimock-fixtures.json:ro" \ - --entrypoint /bin/sh \ - ghcr.io/copilotkit/aimock:latest \ - -c 'sed -i "s/\"Access-Control-Allow-Headers\": \"Content-Type, Authorization\"/\"Access-Control-Allow-Headers\": \"*\"/" dist/server.js && \ - node dist/cli.js --fixtures /fixtures/aimock-fixtures.json --host 0.0.0.0' + -v "$FIXTURES_FILE:/app/fixtures/aimock-fixtures.json:ro" \ + ghcr.io/copilotkit/aimock:latest diff --git a/e2e_tests/tests_omni_light/scripts/run-frontend.sh b/e2e_tests/tests_omni_light/scripts/run-frontend.sh index 9c980611..e2061a32 100755 --- a/e2e_tests/tests_omni_light/scripts/run-frontend.sh +++ b/e2e_tests/tests_omni_light/scripts/run-frontend.sh @@ -22,4 +22,4 @@ cp "$LIGHT_TESTS_DIR/fixtures/modules.json" public/modules.json pnpm install pnpm build -exec pnpm preview +pnpm preview