diff --git a/.github/docker-compose.test.yml b/.github/docker-compose.test.yml index 27f99eb9f0..3eb7c0f5ff 100644 --- a/.github/docker-compose.test.yml +++ b/.github/docker-compose.test.yml @@ -14,11 +14,27 @@ services: # The Unleash server contains the Unleash configuration and # communicates with server-side SDKs and the Unleash Proxy - unleash: - image: 726824350591.dkr.ecr.eu-central-1.amazonaws.com/unleash-enterprise:latest - pull_policy: "always" + frontend: + image: node:20-alpine + working_dir: /app + volumes: + - ..:/app + command: | + sh -c "echo \"Building frontend\" && \ + yarn --cwd ./frontend install && \ + echo \"Waiting for Unleash to start\" && \ + npx wait-on http://unleash:4242/health && \ + echo \"Unleash is up, starting frontend\" && \ + yarn --cwd ./frontend run dev" ports: - - "4242:4242" + - "3000:3000" + environment: + UNLEASH_API: "http://unleash:4242/" + unleash: + image: unleashorg/unleash-enterprise:latest + pull_policy: "always" + expose: + - "4242" environment: DATABASE_URL: "postgres://postgres:unleash@db/unleash" DATABASE_SSL: "false" diff --git a/.github/workflows/e2e.frontend.yaml b/.github/workflows/e2e.frontend.yaml index 9137e3ea6c..3f7614c126 100644 --- a/.github/workflows/e2e.frontend.yaml +++ b/.github/workflows/e2e.frontend.yaml @@ -23,7 +23,6 @@ jobs: uses: actions/checkout@v4 - name: Start Unleash test instance run: | - curl https://app.unleash-hosted.com/docker-login/token/${{ secrets.ECR_ENTERPRISE_TOKEN }} | docker login --username AWS --password-stdin 726824350591.dkr.ecr.eu-central-1.amazonaws.com docker compose -f .github/docker-compose.test.yml up -d --wait -t 90 env: FRONTEND_TEST_LICENSE: ${{ secrets.FRONTEND_TEST_LICENSE }} @@ -32,6 +31,6 @@ jobs: with: working-directory: frontend env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all - config: baseUrl=http://localhost:4242 + config: baseUrl=http://localhost:3000 spec: cypress/integration/${{ matrix.test }} install-command: yarn --immutable diff --git a/frontend/package.json b/frontend/package.json index d94ec6b5d5..ae5e7ce630 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,7 +17,6 @@ "start:sandbox": "UNLEASH_API=https://sandbox.getunleash.io/ VITE_TEST_REDIRECT=true UNLEASH_BASE_PATH=/pro/ yarn run start", "start:sandbox:enterprise": "UNLEASH_API=https://sandbox.getunleash.io/ VITE_TEST_REDIRECT=true UNLEASH_BASE_PATH=/enterprise/ yarn run start", "start:demo2": "UNLEASH_API=https://sandbox.getunleash.io/ UNLEASH_BASE_PATH=/demo2/ yarn run start", - "start:enterprise": "UNLEASH_API=https://unleash.herokuapp.com VITE_TEST_REDIRECT=true yarn run start", "start:demo": "UNLEASH_BASE_PATH=/demo/ UNLEASH_API=https://app.unleash-hosted.com/ yarn run start", "test": "NODE_OPTIONS=\"${NODE_OPTIONS:-0} --no-experimental-fetch\" vitest run", "test:snapshot": "NODE_OPTIONS=\"${NODE_OPTIONS:-0} --no-experimental-fetch\" yarn test -u", @@ -30,7 +29,6 @@ "ts:check": "tsc", "e2e": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --no-experimental-fetch\" yarn run cypress open --config baseUrl='http://localhost:3000' --env AUTH_USER=admin,AUTH_PASSWORD=unleash4all", "e2e:oss": "yarn --cwd frontend run cypress run --spec \"cypress/oss/**/*.spec.ts\" --config baseUrl=\"http://localhost:${EXPOSED_PORT:-4242}\" --env AUTH_USER=admin,AUTH_PASSWORD=unleash4all", - "e2e:heroku": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --no-experimental-fetch\" yarn run cypress open --config baseUrl='https://unleash.herokuapp.com' --env AUTH_USER=admin,AUTH_PASSWORD=unleash4all", "gen:api": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --no-experimental-fetch\" orval --config orval.config.js", "gen:api:demo": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --no-experimental-fetch\" UNLEASH_OPENAPI_URL=https://app.unleash-hosted.com/demo/docs/openapi.json yarn run gen:api", "gen:api:sandbox": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --no-experimental-fetch\" UNLEASH_OPENAPI_URL=https://sandbox.getunleash.io/demo2/docs/openapi.json yarn run gen:api",