diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index cd1135047..1b8ad87c3 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -84,25 +84,34 @@ jobs: env: PLAYWRIGHT_BROWSERS_PATH: /home/runner/.cache/ms-playwright - - name: Setup Caddy - run: | - sudo apt-get update - sudo apt-get install -y debian-keyring debian-archive-keyring apt-transport-https curl - curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg - curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list - sudo apt-get update - sudo apt-get install caddy=2.8.4 + # - name: Setup Caddy + # run: | + # sudo apt-get update + # sudo apt-get install -y debian-keyring debian-archive-keyring apt-transport-https curl + # curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg + # curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list + # sudo apt-get update + # sudo apt-get install caddy=2.8.4 # - name: Setup hosts # run: | # echo "127.0.0.1 app.lms.localhost" | sudo tee -a /etc/hosts - - name: Debug Caddy - working-directory: ./apps/reverse-proxy - run: | - caddy version - caddy adapt --config Caddyfile - caddy validate --config Caddyfile + # - name: Debug Caddy + # working-directory: ./apps/reverse-proxy + # run: | + # caddy version + # caddy adapt --config Caddyfile + # caddy validate --config Caddyfile + + # - name: Start Caddy + # working-directory: ./apps/reverse-proxy + # run: | + # sudo caddy run --config Caddyfile & + + # - name: Ensure Caddy is running + # run: | + # pgrep -af caddy || exit 1 - name: Run tests run: pnpm playwright test diff --git a/apps/web/app/api/api-client.ts b/apps/web/app/api/api-client.ts index c8bc5e35a..aff312f53 100644 --- a/apps/web/app/api/api-client.ts +++ b/apps/web/app/api/api-client.ts @@ -11,7 +11,7 @@ export const requestManager = { }; export const ApiClient = new API({ - baseURL: import.meta.env.VITE_APP_URL, + baseURL: import.meta.env.MODE === "test" ? "http://localhost:3000" : import.meta.env.VITE_APP_URL, secure: true, withCredentials: true, }); diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts index 7b4d53920..5103c2e91 100644 --- a/apps/web/playwright.config.ts +++ b/apps/web/playwright.config.ts @@ -9,7 +9,7 @@ const __dirname = path.dirname(__filename); dotenv.config({ path: path.resolve(__dirname, ".env") }); -const baseURL = process.env.VITE_APP_URL || "https://app.lms.localhost"; +const baseURL = "http://localhost:5173"; export default defineConfig({ testDir: "./e2e", @@ -58,6 +58,7 @@ export default defineConfig({ REDIS_HOST: "localhost", REDIS_PORT: "6380", NODE_ENV: "test", + MODE: "test", }, }, { @@ -65,6 +66,7 @@ export default defineConfig({ env: { DATABASE_URL: `postgresql://test_user:test_password@localhost:54321/test_db`, NODE_ENV: "test", + MODE: "test", }, reuseExistingServer: false, }, @@ -74,14 +76,16 @@ export default defineConfig({ timeout: 120 * 1000, reuseExistingServer: false, env: { - API_URL: "https://app.lms.localhost/api", + API_URL: "http://localhost:3000/api", + NODE_ENV: "test", + MODE: "test", }, }, - { - command: "cd ../reverse-proxy && pnpm run dev", - url: "http://localhost:2019/config/", - timeout: 120 * 1000, - reuseExistingServer: true, - }, + // { + // command: "cd ../reverse-proxy && pnpm run dev", + // url: "http://localhost:2019/config/", + // timeout: 120 * 1000, + // reuseExistingServer: true, + // }, ], });