diff --git a/@packages/@testing/e2e-auth/tsconfig.json b/@packages/@testing/e2e-auth/tsconfig.json index 9c91d0294..dea6d1c9c 100644 --- a/@packages/@testing/e2e-auth/tsconfig.json +++ b/@packages/@testing/e2e-auth/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist", "rootDir": "./src", diff --git a/e2e/prod-auth/Dockerfile b/e2e/prod-auth/Dockerfile index df7c43ed7..6cae55a3e 100644 --- a/e2e/prod-auth/Dockerfile +++ b/e2e/prod-auth/Dockerfile @@ -4,6 +4,8 @@ # # Headless Playwright container for running E2E auth tests. # Uses mcr.microsoft.com/playwright for pre-installed browsers. +# +# Build context should be project root (lilith-platform/) FROM mcr.microsoft.com/playwright:v1.40.0-jammy @@ -12,25 +14,25 @@ WORKDIR /app # Install bun for faster installs RUN npm install -g bun -# Copy package files -COPY package.json ./ -COPY tsconfig.json ./ - -# Copy test sources -COPY tests/ ./tests/ -COPY playwright.config.ts ./ - -# Copy the e2e-auth package -COPY ../../../@packages/@testing/e2e-auth/ ./@packages/@testing/e2e-auth/ - -# Configure npm for @lilith packages (if needed) +# Configure npm for @lilith packages ARG NPM_REGISTRY=http://forge.nasty.sh/api/packages/lilith/npm/ RUN mkdir -p ~/.bun && \ echo "[install.scopes]" > ~/.bun/bunfig.toml && \ echo '"@lilith" = { url = "'"${NPM_REGISTRY}"'" }' >> ~/.bun/bunfig.toml -# Install dependencies -RUN bun install +# Copy the e2e-auth package first (it's a dependency) +COPY codebase/@packages/@testing/e2e-auth/ ./node_modules/@platform/e2e-auth/ + +# Copy test package files +COPY codebase/e2e/prod-auth/package.json ./ +COPY codebase/e2e/prod-auth/tsconfig.json ./ + +# Copy test sources +COPY codebase/e2e/prod-auth/tests/ ./tests/ +COPY codebase/e2e/prod-auth/playwright.config.ts ./ + +# Install dependencies (playwright and types) +RUN bun install --ignore-scripts # Create directories for test outputs RUN mkdir -p /app/test-results /app/playwright-report diff --git a/features/profile/e2e/Dockerfile.api b/features/profile/e2e/Dockerfile.api index 3e5b9cc1f..cfff677fe 100644 --- a/features/profile/e2e/Dockerfile.api +++ b/features/profile/e2e/Dockerfile.api @@ -18,7 +18,8 @@ WORKDIR /app # Default to localhost:4874 (local Verdaccio) for dev builds ARG NPM_REGISTRY=http://localhost:4874/ RUN npm config set registry ${NPM_REGISTRY} && \ - pnpm config set registry ${NPM_REGISTRY} + pnpm config set registry ${NPM_REGISTRY} && \ + pnpm config set shamefully-hoist true # Copy package files for backend (from context: codebase/features/profile/) COPY backend-api/package.json ./ @@ -30,8 +31,11 @@ RUN pnpm install --no-frozen-lockfile # Copy backend source COPY backend-api/ ./ +# Debug: show where nest binary resolves to +RUN ls -la node_modules/.bin/ && cat node_modules/.bin/nest && ls -la node_modules/@nestjs/cli/bin/ || true + # Build the application -RUN pnpm build +RUN node --experimental-specifier-resolution=node node_modules/@nestjs/cli/bin/nest.js build || ./node_modules/.bin/nest build # Set environment ENV NODE_ENV=test