From 25f55ef365e0bd31f11638eaf6b4a398f2427942 Mon Sep 17 00:00:00 2001 From: Elio Bischof Date: Fri, 20 Jun 2025 12:57:39 +0200 Subject: [PATCH] unit --- .github/workflows/test.yml | 22 ++++++++++++++++--- Makefile | 4 ---- apps/login/package.json | 1 - apps/login/turbo.json | 1 - dockerfiles/login-lint.Dockerfile | 3 ++- dockerfiles/login-test-integration.Dockerfile | 1 - dockerfiles/login-test-unit.Dockerfile | 2 +- .../login-test-unit.Dockerfile.dockerignore | 5 +++++ 8 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1da6a6d2b4..2ed0072530 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,9 +57,25 @@ jobs: ${{ runner.os }}-login-run-caches-${{github.ref_name}}-${{ github.sha }}- ${{ runner.os }}-login-run-caches-${{github.ref_name}}- ${{ runner.os }}-login-run-caches- - - name: Show Run Caches - run: make show-run-caches - - run: make login-quality + - run: make login-lint + env: + # latest if branch is main, otherwise image version which is the pull request number + BAKE_CLI: depot bake + DEPOT_PROJECT_ID: jp837jn3fm + FORCE: ${{ github.event.inputs.clean-run-caches == 'true' }} + - run: make login-test-unit + env: + # latest if branch is main, otherwise image version which is the pull request number + BAKE_CLI: depot bake + DEPOT_PROJECT_ID: jp837jn3fm + FORCE: ${{ github.event.inputs.clean-run-caches == 'true' }} + - run: make login-test-integration + env: + # latest if branch is main, otherwise image version which is the pull request number + BAKE_CLI: depot bake + DEPOT_PROJECT_ID: jp837jn3fm + FORCE: ${{ github.event.inputs.clean-run-caches == 'true' }} + - run: make login-test-acceptance env: # latest if branch is main, otherwise image version which is the pull request number BAKE_CLI: depot bake diff --git a/Makefile b/Makefile index 090a97fb11..0bdb0c2c2a 100644 --- a/Makefile +++ b/Makefile @@ -87,10 +87,6 @@ login-test-acceptance: login-test-acceptance-build $(LOGIN_TEST_ACCEPTANCE_OIDCRP_TAG) \ $(LOGIN_TEST_ACCEPTANCE_SAMLSP_TAG)" -.PHONY: login-quality -login-quality: login-lint login-test-integration login-test-acceptance - @: - .PHONY: login-standalone-build login-standalone-build: $(BAKE_CLI_WITH_COMMON_ARGS) login-standalone diff --git a/apps/login/package.json b/apps/login/package.json index 21ba0bb932..393c8b54ef 100644 --- a/apps/login/package.json +++ b/apps/login/package.json @@ -5,7 +5,6 @@ "scripts": { "dev": "pnpm exec next dev --turbopack", "test:unit": "pnpm exec vitest", - "test:unit:standalone": "pnpm test:unit", "test:unit:watch": "pnpm test:unit --watch", "lint": "pnpm exec next lint && pnpm exec prettier --check .", "lint:fix": "pnpm exec prettier --write .", diff --git a/apps/login/turbo.json b/apps/login/turbo.json index bc63a2dbc4..030d45d581 100644 --- a/apps/login/turbo.json +++ b/apps/login/turbo.json @@ -14,7 +14,6 @@ "test:unit": { "dependsOn": ["@zitadel/client#build"] }, - "test:unit:standalone": {}, "test:watch": { "dependsOn": ["@zitadel/client#build"] } diff --git a/dockerfiles/login-lint.Dockerfile b/dockerfiles/login-lint.Dockerfile index 3998c0ebe6..6bf91fdf6d 100644 --- a/dockerfiles/login-lint.Dockerfile +++ b/dockerfiles/login-lint.Dockerfile @@ -4,6 +4,7 @@ COPY packages/zitadel-tsconfig packages/zitadel-tsconfig COPY packages/zitadel-prettier-config packages/zitadel-prettier-config COPY packages/zitadel-eslint-config packages/zitadel-eslint-config COPY apps/login/package.json apps/login/ -RUN pnpm install --frozen-lockfile --prefer-offline --workspace-root --filter zitadel-login +RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ + pnpm install --frozen-lockfile --workspace-root --filter apps/login COPY apps/login apps/login RUN pnpm lint && pnpm format --check diff --git a/dockerfiles/login-test-integration.Dockerfile b/dockerfiles/login-test-integration.Dockerfile index c3ee471fde..5fa40d6e9c 100644 --- a/dockerfiles/login-test-integration.Dockerfile +++ b/dockerfiles/login-test-integration.Dockerfile @@ -2,7 +2,6 @@ FROM login-pnpm AS login-test-integration-dependencies COPY ./apps/login-test-integration/package.json ./apps/login-test-integration/package.json RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ pnpm install --frozen-lockfile --filter=login-test-integration - FROM cypress/factory:5.10.0 AS login-test-integration WORKDIR /opt/app COPY --from=login-test-integration-dependencies /build/apps/login-test-integration . diff --git a/dockerfiles/login-test-unit.Dockerfile b/dockerfiles/login-test-unit.Dockerfile index d456a4fac4..b0cfdbd086 100644 --- a/dockerfiles/login-test-unit.Dockerfile +++ b/dockerfiles/login-test-unit.Dockerfile @@ -3,4 +3,4 @@ COPY apps/login/package.json ./apps/login/ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ pnpm install --frozen-lockfile --workspace-root --filter ./apps/login COPY apps/login ./apps/login -RUN pnpm test:unit:standalone +RUN cd apps/login && pnpm test:unit diff --git a/dockerfiles/login-test-unit.Dockerfile.dockerignore b/dockerfiles/login-test-unit.Dockerfile.dockerignore index 4ba8e9ef2e..c063dc8847 100644 --- a/dockerfiles/login-test-unit.Dockerfile.dockerignore +++ b/dockerfiles/login-test-unit.Dockerfile.dockerignore @@ -4,3 +4,8 @@ !/apps/login/locales !/apps/login/constants !/apps/login/*.json +!/apps/login/*.mjs +!/apps/login/*.mts +!/apps/login/*.d.ts +!/packages/zitadel-tailwind-config/package.json +!/packages/zitadel-tailwind-config/tailwind.config.mjs