diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml new file mode 100644 index 0000000000..36ba8caca9 --- /dev/null +++ b/.github/workflows/cypress.yml @@ -0,0 +1,20 @@ +name: CYPRESS e2e + +on: +# schedule: +# - cron: '*/15 * * * *' + workflow_dispatch: + + + +env: + WORKING_DIR=./ + +jobs: + test: + runs-on: ubuntu-18.04 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Build the docker-compose stack + run: COMPOSE_DOCKER_CLI_BUILD=1 docker compose --verbose --file ${WORKING_DIR}/e2e/docker-compose-workdir.yaml --file ${WORKING_DIR}/docs/docs/guides/installation/run/docker-compose.yaml --file ${WORKING_DIR}/e2e/docker-compose-overwrite.yaml --env-file ${WORKING_DIR}/e2e/compose.env diff --git a/console/cypress.sh b/console/cypress.sh index 4cd4a0228f..4f62de4d7c 100755 --- a/console/cypress.sh +++ b/console/cypress.sh @@ -19,6 +19,26 @@ if ! command -v cypress &> /dev/null; then NPX="npx" fi +############################### +function zitadel-health-check { +############################### +# this is needed to ensure zitadel has finished its startup +i=1 +until [ $i -gt 10 ]; do + HEALTHSTATUS=$(curl zitadel:8080/healthz | tail -n1) + if [ $HEALTHSTATUS == '{"status":"ok"}' ]; then + echo "ZITADEL is up and running" + break + else echo "ZITADEL is starting" + sleep 1 + fi + i=$[$i+1]; +done +} + + +zitadel-health-check + $NPX cypress $ACTION \ --port "${E2E_CYPRESSPORT}" \ --env org="${ZITADEL_E2E_ORG}",org_owner_password="${ZITADEL_E2E_ORGOWNERPW}",org_owner_viewer_password="${ZITADEL_E2E_ORGOWNERVIEWERPW}",org_project_creator_password="${ZITADEL_E2E_ORGPROJECTCREATORPW}",login_policy_user_password="${ZITADEL_E2E_LOGINPOLICYUSERPW}",password_complexity_user_password="${ZITADEL_E2E_PASSWORDCOMPLEXITYUSERPW}",baseUrl="${ZITADEL_E2E_BASEURL}",serviceAccountKeyPath="${ZITADEL_E2E_MACHINEKEYPATH}",otherZitadelIdpInstance="${ZITADEL_E2E_OTHERZITADELIDPINSTANCE}",zitadelProjectResourceId="${ZITADEL_E2E_ZITADELPROJECTRESOURCEID}" \ diff --git a/e2e/dbdump/BACKUP-STATISTICS b/e2e/dbdump/BACKUP-STATISTICS new file mode 100644 index 0000000000..d5eab5d9de Binary files /dev/null and b/e2e/dbdump/BACKUP-STATISTICS differ diff --git a/e2e/dbdump/BACKUP_MANIFEST b/e2e/dbdump/BACKUP_MANIFEST new file mode 100644 index 0000000000..136da00e41 Binary files /dev/null and b/e2e/dbdump/BACKUP_MANIFEST differ diff --git a/e2e/dbdump/BACKUP_MANIFEST-CHECKSUM b/e2e/dbdump/BACKUP_MANIFEST-CHECKSUM new file mode 100644 index 0000000000..51e8918a99 --- /dev/null +++ b/e2e/dbdump/BACKUP_MANIFEST-CHECKSUM @@ -0,0 +1 @@ +Sµ>¨ \ No newline at end of file diff --git a/e2e/dbdump/data/782709337179422721.sst b/e2e/dbdump/data/782709337179422721.sst new file mode 100644 index 0000000000..7f8ceeb5f7 Binary files /dev/null and b/e2e/dbdump/data/782709337179422721.sst differ diff --git a/e2e/dbdump/data/782709337201180673.sst b/e2e/dbdump/data/782709337201180673.sst new file mode 100644 index 0000000000..e24f330acb Binary files /dev/null and b/e2e/dbdump/data/782709337201180673.sst differ diff --git a/e2e/dbdump/data/782709337210486785.sst b/e2e/dbdump/data/782709337210486785.sst new file mode 100644 index 0000000000..7c67f82546 Binary files /dev/null and b/e2e/dbdump/data/782709337210486785.sst differ diff --git a/e2e/dbdump/data/782709337234604033.sst b/e2e/dbdump/data/782709337234604033.sst new file mode 100644 index 0000000000..7bb517eed5 Binary files /dev/null and b/e2e/dbdump/data/782709337234604033.sst differ diff --git a/e2e/dbdump/data/782709337240076289.sst b/e2e/dbdump/data/782709337240076289.sst new file mode 100644 index 0000000000..52edef8c95 Binary files /dev/null and b/e2e/dbdump/data/782709337240076289.sst differ diff --git a/e2e/dbdump/data/782709337253543937.sst b/e2e/dbdump/data/782709337253543937.sst new file mode 100644 index 0000000000..fed5021d75 Binary files /dev/null and b/e2e/dbdump/data/782709337253543937.sst differ diff --git a/e2e/dbdump/fileinfo.sst b/e2e/dbdump/fileinfo.sst new file mode 100644 index 0000000000..c9e1f811d5 Binary files /dev/null and b/e2e/dbdump/fileinfo.sst differ diff --git a/e2e/dbdump/metadata.sst b/e2e/dbdump/metadata.sst new file mode 100644 index 0000000000..13ae693e67 Binary files /dev/null and b/e2e/dbdump/metadata.sst differ diff --git a/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbc8cbc6ccc9cbdfd4cfcfcfcfdfaaabbcfffe b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbc8cbc6ccc9cbdfd4cfcfcfcfdfaaabbcfffe new file mode 100644 index 0000000000..655f5afb97 Binary files /dev/null and b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbc8cbc6ccc9cbdfd4cfcfcfcfdfaaabbcfffe differ diff --git a/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbc8cbc6ccc9cbdfd4cfcfcfcfdfaaabbcfffe-CHECKSUM b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbc8cbc6ccc9cbdfd4cfcfcfcfdfaaabbcfffe-CHECKSUM new file mode 100644 index 0000000000..d9b5c59984 --- /dev/null +++ b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbc8cbc6ccc9cbdfd4cfcfcfcfdfaaabbcfffe-CHECKSUM @@ -0,0 +1 @@ +­ Àw \ No newline at end of file diff --git a/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbcdcecec9c8c8dfd4cfcfcfcfdfaaabbcfffe b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbcdcecec9c8c8dfd4cfcfcfcfdfaaabbcfffe new file mode 100644 index 0000000000..dca66eac55 Binary files /dev/null and b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbcdcecec9c8c8dfd4cfcfcfcfdfaaabbcfffe differ diff --git a/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbcdcecec9c8c8dfd4cfcfcfcfdfaaabbcfffe-CHECKSUM b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbcdcecec9c8c8dfd4cfcfcfcfdfaaabbcfffe-CHECKSUM new file mode 100644 index 0000000000..3cfda97edd --- /dev/null +++ b/e2e/dbdump/progress/BACKUP-CHECKPOINT-13cdcfcdcdd2cfc8d2cdc8dfcecac5cfcac5ccccd1cbcdcecec9c8c8dfd4cfcfcfcfdfaaabbcfffe-CHECKSUM @@ -0,0 +1 @@ +@X…æ \ No newline at end of file diff --git a/e2e/docker-compose-overwrite.yaml b/e2e/docker-compose-overwrite.yaml index d4c5523421..b8b0821a7b 100644 --- a/e2e/docker-compose-overwrite.yaml +++ b/e2e/docker-compose-overwrite.yaml @@ -1,35 +1,33 @@ services: zitadel: - image: 'zitadel:${BUILD_DATE}' + image: 'ghcr.io/zitadel/zitadel:v2.0.0-v2-alpha.44-amd64' + command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --tlsMode disabled' environment: # TODO: ugly ZITADEL_EXTERNALDOMAIN: zitadel ZITADEL_S3DEFAULTINSTANCE_CUSTOMDOMAIN: zitadel - - e2e-setup: - build: - dockerfile: ./build/e2e/Dockerfile - context: .. - container_name: e2e-setup - env_file: - - ./compose.env - environment: - ZITADEL_DATABASE_HOST: db - networks: - - 'zitadel' - volumes: - - ${PWD}/.keys/e2e.json:/.keys/e2e.json depends_on: - zitadel: -# TODO: See PR #3816 -# condition: 'service_healthy' - condition: service_started + db-initialize: + condition: service_completed_successfully + + db: + volumes: + - ${PWD}/e2e/dbdump:/cockroach/cockroach-data/extern/dbdump + + db-initialize: + networks: + - 'zitadel' + image: 'cockroachdb/cockroach:v22.1.0' + command: "sql --host db --insecure --execute=\'RESTORE FROM \"nodelocal://0/dbdump/\"\'" + depends_on: + db: + condition: service_healthy + e2e: image: cypress/included:10.3.0 container_name: cypress depends_on: - e2e-setup: - condition: 'service_completed_successfully' + - zitadel env_file: - ./compose.env working_dir: /e2e @@ -43,4 +41,3 @@ services: - ${PWD}/console:/e2e networks: - 'zitadel' -