cache compose tests

This commit is contained in:
Elio Bischof
2025-06-18 13:11:26 +02:00
parent 67f47aac2e
commit 6de807eb4d
9 changed files with 33 additions and 15 deletions

View File

@@ -1,11 +1,12 @@
XDG_CACHE_HOME ?= $(HOME)/.cache
export CACHE_DIR ?= $(XDG_CACHE_HOME)/zitadel-make
export BAKE_CLI ?= docker buildx bake
export BAKE_CLI ?= docker buildx bake --file ./docker-bake.hcl
export REF_TAG ?= local
export LOGIN_TAG := login:${REF_TAG}
export LOGIN_TEST_UNIT_TAG := login-test-unit:${REF_TAG}
export LOGIN_TEST_INTEGRATION_TAG ?= login-test-integration:${REF_TAG}
export LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT := apps/login-test-acceptance
export LOGIN_TEST_ACCEPTANCE_TAG := login-test-acceptance:${REF_TAG}
export LOGIN_TEST_ACCEPTANCE_SETUP_TAG := login-test-acceptance-setup:${REF_TAG}
export LOGIN_TEST_ACCEPTANCE_SINK_TAG := login-test-acceptance-sink:${REF_TAG}
@@ -55,8 +56,8 @@ login-test-integration: login-standalone-build login-test-integration-build
$(CORE_MOCK_TAG) \
$(LOGIN_TEST_INTEGRATION_TAG)"
login-test-acceptance-build:
$(BAKE_CLI) --file ./apps/login-test-acceptance/docker-compose.yaml setup sink oidcop samlsp samlidp login-standalone login-test-acceptance
login-test-acceptance-build: login-standalone-build
$(BAKE_CLI) --file ./apps/login-test-acceptance/docker-compose.yaml setup sink oidcrp oidcop samlsp samlidp login-test-acceptance
login-test-acceptance-run: login-acceptance-cleanup
docker compose --file ./apps/login-test-acceptance/docker-compose.yaml run --rm --service-ports acceptance
@@ -64,7 +65,7 @@ login-test-acceptance-run: login-acceptance-cleanup
login-acceptance-cleanup:
docker compose --file ./apps/login-test-acceptance/docker-compose.yaml down --volumes
login-test-acceptance: login-standalone-build login-test-acceptance-build
login-test-acceptance: login-test-acceptance-build
./scripts/run_or_skip.sh login-test-acceptance-run \
"$(LOGIN_TAG) \
$(ZITADEL_TAG) \
@@ -79,7 +80,7 @@ login-test-acceptance: login-standalone-build login-test-acceptance-build
$(LOGIN_TEST_ACCEPTANCE_SAMLIDP_TAG)"
.PHONY: login-quality
login-quality: login-lint login-test-unit login-test-integration login-test-acceptance
login-quality: login-lint login-test-integration login-test-acceptance
@:
.PHONY: login-standalone-build

View File

@@ -1,3 +0,0 @@
go-command
.env.local
test-results

View File

@@ -74,7 +74,7 @@ services:
container_name: acceptance-setup
image: ${LOGIN_TEST_ACCEPTANCE_SETUP_TAG:-login-test-acceptance-setup:local}
build:
context: ./setup
context: ${LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT:-.}/setup
dockerfile: ../go-command.Dockerfile
entrypoint: "./setup.sh"
environment:
@@ -116,7 +116,7 @@ services:
image: ${LOGIN_TEST_ACCEPTANCE_SINK_TAG:-login-test-acceptance-sink:local}
container_name: acceptance-sink
build:
context: ./sink
context: ${LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT:-.}/sink
dockerfile: ../go-command.Dockerfile
args:
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
@@ -141,7 +141,7 @@ services:
image: ${LOGIN_TEST_ACCEPTANCE_OIDCRP_TAG:-login-test-acceptance-oidcrp:local}
container_name: acceptance-oidcrp
build:
context: ./oidcrp
context: ${LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT:-.}/oidcrp
dockerfile: ../go-command.Dockerfile
args:
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
@@ -168,7 +168,7 @@ services:
image: ${LOGIN_TEST_ACCEPTANCE_OIDCOP_TAG:-login-test-acceptance-oidcop:local}
container_name: acceptance-oidcop
build:
context: ./idp/oidc
context: ${LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT:-.}/idp/oidc
dockerfile: ../../go-command.Dockerfile
args:
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
@@ -193,7 +193,7 @@ services:
image: ${LOGIN_TEST_ACCEPTANCE_SAMLSP_TAG:-login-test-acceptance-samlsp:local}
container_name: acceptance-samlsp
build:
context: ./samlsp
context: ${LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT:-.}/samlsp
dockerfile: ../go-command.Dockerfile
args:
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
@@ -217,7 +217,7 @@ services:
image: ${LOGIN_TEST_ACCEPTANCE_SAMLIDP_TAG:-login-test-acceptance-samlidp:local}
container_name: acceptance-samlidp
build:
context: ./idp/saml
context: ${LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT:-.}/idp/saml
dockerfile: ../../go-command.Dockerfile
args:
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}

View File

@@ -0,0 +1,5 @@
*
!/apps/login-test-acceptance/*.json
!/apps/login-test-acceptance/*.ts
!/apps/login-test-acceptance/zitadel.yaml
!/apps/login-test-acceptance/tests

View File

@@ -0,0 +1,6 @@
*
!/apps/login-test-integration/*.json
!/apps/login-test-integration/*.ts
!/apps/login-test-integration/integration
!/apps/login-test-integration/fixtures
!/apps/login-test-integration/support

View File

@@ -1,6 +1,6 @@
FROM login-client AS login-test-unit
COPY apps/login/package.json ./apps/login/
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile --workspace-root --filter zitadel-client
pnpm install --frozen-lockfile --workspace-root --filter ./apps/login
COPY apps/login ./apps/login
RUN pnpm test:unit:standalone

View File

@@ -0,0 +1,6 @@
*
!/apps/login/src
!/apps/login/public
!/apps/login/locales
!/apps/login/constants
!/apps/login/*.json

View File

@@ -0,0 +1 @@
*

View File

@@ -0,0 +1,2 @@
*
!/packages/zitadel-proto/