This commit is contained in:
Elio Bischof
2025-08-05 17:28:47 +02:00
parent 3b81f1bd75
commit 41ca21491c
5 changed files with 76 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ services:
zitadel: zitadel:
container_name: zitadel container_name: zitadel
image: "${ZITADEL_TAG:-ghcr.io/zitadel/zitadel:v4.0.0-rc.2}" image: "${ZITADEL_TAG:-zitadel:local}"
command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --config /zitadel.yaml --steps /zitadel.yaml' command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --config /zitadel.yaml --steps /zitadel.yaml'
volumes: volumes:
- ../../apps/login/acceptance/pat:/pat:delegated - ../../apps/login/acceptance/pat:/pat:delegated
@@ -56,7 +56,10 @@ services:
login-acceptance: login-acceptance:
container_name: login container_name: login
image: "${LOGIN_TAG:-ghcr.io/zitadel/zitadel-login:v4.0.0-rc.2}" image: "${LOGIN_TAG:-zitadel-login:local}"
build:
context: ../..
dockerfile: build/login/Dockerfile
network_mode: service:zitadel network_mode: service:zitadel
environment: environment:
NEXT_PUBLIC_BASE_PATH: /ui/v2/login NEXT_PUBLIC_BASE_PATH: /ui/v2/login

View File

@@ -0,0 +1,64 @@
name: Acceptance Test Login
on:
workflow_call:
inputs:
login_build_image:
required: true
type: string
zitadel_build_image:
required: true
type: string
permissions:
packages: write
jobs:
login-acceptance-test:
name: login-acceptance-test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dev Container CLI
run: npm install -g @devcontainers/cli@0.80.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Pull Login Build Image
run: docker compose --file .devcontainer/login-acceptance/docker-compose.yaml pull
env:
LOGIN_TAG: ${{ inputs.login_build_image }}
ZITADEL_TAG: ${{ inputs.zitadel_build_image }}
- name: Run Integration Tests against the Login and a Mocked Zitadel API
run: npm run devcontainer:acceptance:login
env:
LOGIN_TAG: ${{ inputs.login_build_image }}
ZITADEL_TAG: ${{ inputs.zitadel_build_image }}
DOCKER_BUILDKIT: 1
- name: Fix Failures
if: failure()
run: |
echo "Reproduce this check locally:"
echo "LOGIN_TAG=${{ inputs.login_build_image }} ZITADEL_TAG=${{ inputs.login_build_image }} npm run devcontainer:acceptance:login"
echo "To fix the failures, open the dev container called \"Login Acceptance\"."
echo "You will have the same environment as the pipeline check as well as some guidance on how to fix the errors."
- name: Show Compose Status
if: failure()
run: docker compose --file .devcontainer/base/docker-compose.yaml --file .devcontainer/login-acceptance/docker-compose.yaml ps
- name: Print Config
if: failure()
run: COMPOSE_BAKE=1 docker compose --file .devcontainer/login-acceptance/docker-compose.yaml config login-acceptance
env:
LOGIN_TAG: ${{ inputs.login_build_image }}
ZITADEL_TAG: ${{ inputs.zitadel_build_image }}
- name: Show Container Logs
if: failure()
run: docker compose --file .devcontainer/login-acceptance/docker-compose.yaml logs --timestamps --no-color --tail 100 login-acceptance
- name: Inspect All Failed Containers
if: failure()
run: |
docker ps -a --filter "status=exited" --filter "status=created" --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Image}}"
for container in $(docker ps -a --filter "status=exited" --filter "status=created" -q); do
echo "Inspecting container $container"
docker inspect $container || true
done

View File

@@ -1,4 +1,4 @@
name: Integration test core name: Integration Test Login
on: on:
workflow_call: workflow_call:
@@ -35,19 +35,19 @@ jobs:
run: | run: |
echo "Reproduce this check locally:" echo "Reproduce this check locally:"
echo "LOGIN_TAG=${{ inputs.login_build_image }} npm run devcontainer:integration:login" echo "LOGIN_TAG=${{ inputs.login_build_image }} npm run devcontainer:integration:login"
echo "To fix the failures, open the dev container called \"Login Integration Tests\"." echo "To fix the failures, open the dev container called \"Login Integration\"."
echo "You will have the same environment as the pipeline check as well as some guidance on how to fix the errors." echo "You will have the same environment as the pipeline check as well as some guidance on how to fix the errors."
- name: Show Compose Status - name: Show Compose Status
if: failure() if: failure()
run: docker compose --file .devcontainer/base/docker-compose.yaml --file .devcontainer/login-integration-ci/docker-compose.yaml ps run: docker compose --file .devcontainer/login-integration/docker-compose.yaml ps
- name: Print Config - name: Print Config
if: failure() if: failure()
run: COMPOSE_BAKE=1 docker compose --file .devcontainer/base/docker-compose.yaml --file .devcontainer/login-integration-ci/docker-compose.yaml config login-integration run: COMPOSE_BAKE=1 docker compose --file .devcontainer/base/docker-compose.yaml --file .devcontainer/login-integration/docker-compose.yaml config login-integration
env: env:
LOGIN_TAG: ${{ inputs.login_build_image }} LOGIN_TAG: ${{ inputs.login_build_image }}
- name: Show Container Logs - name: Show Container Logs
if: failure() if: failure()
run: docker compose --file .devcontainer/base/docker-compose.yaml --file .devcontainer/login-integration-ci/docker-compose.yaml logs --timestamps --no-color --tail 100 login-integration run: docker compose --file .devcontainer/login-integration/docker-compose.yaml logs --timestamps --no-color --tail 100 login-integration
- name: Inspect All Failed Containers - name: Inspect All Failed Containers
if: failure() if: failure()
run: | run: |

View File

@@ -8,6 +8,7 @@
"devcontainer:lint-unit": "FAIL_COMMANDS_ON_ERRORS=true devcontainer up --prebuild --config .devcontainer/turbo-lint-unit/devcontainer.json --workspace-folder .", "devcontainer:lint-unit": "FAIL_COMMANDS_ON_ERRORS=true devcontainer up --prebuild --config .devcontainer/turbo-lint-unit/devcontainer.json --workspace-folder .",
"devcontainer:integration:login": "FAIL_COMMANDS_ON_ERRORS=true devcontainer up --prebuild --config .devcontainer/login-integration/devcontainer.json --workspace-folder .", "devcontainer:integration:login": "FAIL_COMMANDS_ON_ERRORS=true devcontainer up --prebuild --config .devcontainer/login-integration/devcontainer.json --workspace-folder .",
"devcontainer:acceptance:login": "FAIL_COMMANDS_ON_ERRORS=true devcontainer up --prebuild --config .devcontainer/login-acceptance/devcontainer.json --workspace-folder .", "devcontainer:acceptance:login": "FAIL_COMMANDS_ON_ERRORS=true devcontainer up --prebuild --config .devcontainer/login-acceptance/devcontainer.json --workspace-folder .",
"devcontainer:acceptance:login:build": "make docker_image && docker compose --file .devcontainer/login-acceptance/docker-compose.yaml build --pull",
"clean": "turbo run clean", "clean": "turbo run clean",
"clean:all": "pnpm run clean && rm -rf .turbo node_modules" "clean:all": "pnpm run clean && rm -rf .turbo node_modules"
}, },