mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-14 15:03:12 +00:00
make cypress run
This commit is contained in:
@@ -5,8 +5,10 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/command"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
@@ -26,6 +28,11 @@ func execute(ctx context.Context, cmd *command.Commands, cfg E2EConfig, users []
|
||||
Human: *orgOwner,
|
||||
})
|
||||
if err != nil {
|
||||
// TODO: Why is this error not typed?
|
||||
if strings.Contains(err.Error(), "Errors.Org.AlreadyExists") {
|
||||
logging.New().Info("Looks like setup is already done")
|
||||
err = nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ services:
|
||||
ZITADEL_S3DEFAULTINSTANCE_CUSTOMDOMAIN: zitadel
|
||||
|
||||
e2e-setup:
|
||||
command: ./e2e/e2e-setup.sh
|
||||
build:
|
||||
dockerfile: ./build/e2e/Dockerfile
|
||||
context: ..
|
||||
@@ -27,34 +26,21 @@ services:
|
||||
condition: service_started
|
||||
e2e:
|
||||
image: cypress/included:10.3.0
|
||||
#build: ./e2e
|
||||
container_name: cypress
|
||||
depends_on:
|
||||
e2e-setup:
|
||||
condition: 'service_completed_successfully'
|
||||
env_file:
|
||||
- ./compose.env
|
||||
command: ./cypress.sh run
|
||||
working_dir: /e2e
|
||||
entrypoint:
|
||||
- bash
|
||||
- -c
|
||||
command:
|
||||
- ./cypress.sh run
|
||||
volumes:
|
||||
- ${PWD}/.keys/e2e.json:/.keys/e2e.json
|
||||
# note: inside e2e container, the network allows accessing
|
||||
# "zitadel" host under name "zitadel"
|
||||
# so "curl http://web" would return whatever the webserver
|
||||
# in the "web" container is cooking
|
||||
# see https://docs.docker.com/compose/networking/
|
||||
#environment:
|
||||
# - CYPRESS_baseUrl=http://web
|
||||
#command: npx cypress run
|
||||
# mount the host directory e2e/cypress and the file e2e/cypress.config.js as
|
||||
# volumes within the container
|
||||
# this means that:
|
||||
# 1. anything that Cypress writes to these folders (e.g., screenshots,
|
||||
# videos) appears also on the Docker host's filesystem
|
||||
# 2. any change that the developer applies to Cypress files on the host
|
||||
# machine immediately takes effect within the e2e container (no docker
|
||||
# rebuild required).
|
||||
working_dir: /e2e
|
||||
volumes:
|
||||
- ./console:/e2e
|
||||
- ${PWD}/console:/e2e
|
||||
networks:
|
||||
- 'zitadel'
|
||||
|
||||
|
||||
@@ -57,5 +57,5 @@ fi
|
||||
|
||||
if [ "$DO_DEPLOY" -eq "1" ]; then
|
||||
# run cockroach and zitadel
|
||||
./e2e/docker-compose.sh up --detach
|
||||
./e2e/docker-compose.sh up --build --detach
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user