make cypress run

This commit is contained in:
Elio Bischof
2022-07-25 16:33:53 +02:00
parent a3fb6dba12
commit df428a75e2
3 changed files with 16 additions and 23 deletions

View File

@@ -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
}

View File

@@ -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'

View File

@@ -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