build custom cypress image

This commit is contained in:
Elio Bischof 2022-08-26 17:15:57 +02:00
parent 74965412e8
commit bc2caaac9c
No known key found for this signature in database
GPG Key ID: 7B383FDE4DDBF1BD
5 changed files with 22 additions and 13 deletions

View File

@ -34,6 +34,9 @@ jobs:
with:
driver: docker
install: true
- name: Build e2e image
run: docker compose build
working-directory: e2e
- name: Test ${{ matrix.browser }}
run: docker compose run e2e --browser ${{ matrix.browser }}
working-directory: e2e

View File

@ -37,6 +37,9 @@ jobs:
# As goreleaser doesn't build a dockerfile in snapshot mode, we have to build it here
- name: Build Docker Image
run: docker build -t zitadel:pr --file build/Dockerfile .artifacts/zitadel
- name: Build e2e image
run: docker compose build
working-directory: e2e
- name: Run E2E Tests
run: docker compose run e2e
working-directory: e2e

View File

@ -158,6 +158,9 @@ goreleaser build --id prod --snapshot --single-target --rm-dist --output .artifa
# Pack the binary into a docker image
DOCKER_BUILDKIT=1 docker build --file build/Dockerfile .artifacts/zitadel -t zitadel:local
# Build the e2e image
docker compose --file ./e2e/docker-compose.yaml build
# Run the tests
ZITADEL_IMAGE=zitadel:local docker compose --file ./e2e/docker-compose.yaml run e2e
```
@ -210,7 +213,7 @@ You can now run a local development server with live code reloading at http://lo
To allow console access via http://localhost:4200, you have to configure the ZITADEL backend.
1. Navigate to http://localhost:8080/ui/console/projects.
2. When prompted, login with *zitadel-admin@<span because="breaks the mailto"></span>zitadel.localhost* and *Password1!*.
2. When prompted, login with *zitadel-admin@<span because="breaks the mailto"></span>zitadel.localhost* and *Password1!*
3. Select the *ZITADEL* project.
3. Select the *Console* application.
4. Select *Redirect Settings*

10
e2e/Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM cypress/included:10.3.0
WORKDIR dependencies
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
ENTRYPOINT [ "bash", "-c" ]
CMD [ "cp -R /dependencies/node_modules/ . && cypress run --help" ]

View File

@ -33,25 +33,15 @@ services:
networks:
- zitadel
npm-install:
image: node:18-alpine3.15
working_dir: /e2e
user: "$UID"
volumes:
- .:/e2e
command: "npm ci --omit=dev"
e2e:
image: cypress/included:10.3.0
build:
context: .
depends_on:
zitadel:
condition: 'service_started'
db:
condition: 'service_healthy'
npm-install:
condition: 'service_completed_successfully'
working_dir: /e2e
user: "$UID"
volumes:
- .:/e2e
network_mode: host