1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-18 13:48:58 +02:00
unleash.unleash/.github/workflows/e2e.frontend.yaml
Gastón Fournier 5f238d6b6d
chore: use a local image of unleash enterprise for testing FE (#9509)
This removes the need of running a heroku instance with enterprise to
run frontend tests. We can also get rid of vercel deployments of the
frontend for PRs (ofc we'd be loosing the preview if we do this)

It relies on the free enterprise docker image to spin up a clean Unleash
instance on each frontend spec test.

It also seems to speed up tests, I guess because we don't have to wait
for vercel deployment queue:

![image](https://github.com/user-attachments/assets/60a2aef1-9a5a-442d-b241-8c5c145c679e)


Compared with other recent PRs:

![image](https://github.com/user-attachments/assets/9a7498aa-26e6-48a4-aba0-c67e5380ced4)

Unrelated to this PR but something is making the features spec tests
very slow since Cypress upgrade:
https://github.com/Unleash/unleash/actions/runs/13784760762/job/38550079932#step:4:138
2025-03-12 13:47:36 +01:00

38 lines
1.2 KiB
YAML

name: e2e:frontend
on:
pull_request:
# paths:
# - 'frontend/**'
jobs:
e2e:
runs-on: ubuntu-latest
strategy:
matrix:
test:
- feature/feature.spec.ts
- groups/groups.spec.ts
- projects/access.spec.ts
- segments/segments.spec.ts
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: Checkout
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 }}
- name: Run Cypress
uses: cypress-io/github-action@v6
with:
working-directory: frontend
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
config: baseUrl=http://localhost:4242
spec: cypress/integration/${{ matrix.test }}
install-command: yarn --immutable