1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/docker-compose.yaml
jbpratt 0638c19183 test(web): migrate more tests to playwright (#4767)
* test(web): migrate repository-autopruning to Playwright

Consolidate 17 Cypress tests into 6 Playwright tests:
- policy lifecycle (create, update, delete)
- policy with tag pattern filter
- multiple policies lifecycle
- namespace policy display in repository settings
- registry policy display
- error handling (load failure)

Uses @feature:AUTO_PRUNE tag for automatic test skipping.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* test: enable features by default

Signed-off-by: Brady Pratt <bpratt@redhat.com>

* test(web): migrate create-account.cy.ts to Playwright

Migrates the Create Account Cypress tests to Playwright following
the MIGRATION.md guide:

- Consolidates 10 Cypress tests into 6 focused Playwright tests
- Uses real API calls instead of mocks
- Adds data-testid attributes to CreateAccount component
- Uses @feature:MAILING and @feature:QUOTA_MANAGEMENT tags
  to skip tests when features are not enabled
- Creates custom fixtures for unauthenticated page access
- Implements proper user cleanup after tests

Tests:
- form validation prevents invalid submissions
- creates account with valid inputs and redirects
- shows error for existing username
- navigates to signin page via link
- shows verification message (requires MAILING)
- redirects to updateuser (requires QUOTA_MANAGEMENT)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Brady Pratt <bpratt@redhat.com>

* chore(dev) add Mailpit for local email testing

Add Mailpit email testing server to the local development environment
to enable testing of FEATURE_MAILING functionality with Playwright.

Changes:
- Add mailpit service to docker-compose.yaml (ports 8025/1025)
- Enable FEATURE_MAILING and configure SMTP settings in config.yaml
- Add mailpit utilities to Playwright fixtures (getEmails, clearInbox,
  waitForEmail, getEmailBody, isAvailable)

Usage:
  podman-compose up mailpit -d
  # Access Web UI at http://localhost:8025

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(web) use mailpit helpers for email confirmation support

Test updates:
- "creates account and redirects to organization" now confirms email
- "redirects to updateuser when user has prompts" now confirms email
- Tests detect FEATURE_MAILING at runtime and adapt accordingly
- Email search uses recipient address for parallel test safety

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Brady Pratt <bpratt@redhat.com>

* test(web): use mailpit for email notification test

Replace mocked email authorization with real Mailpit verification
in the notifications.spec.ts test.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Brady Pratt <bpratt@redhat.com>

* test(web): mock user response in cypress test

this broke when mailing was enabled

Signed-off-by: Brady Pratt <bpratt@redhat.com>

---------

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-05 09:47:29 -08:00

191 lines
4.6 KiB
YAML

version: "3.7"
volumes:
quay-db-data:
clair-db-data:
services:
quay-db:
user: postgres
container_name: quay-db
image: docker.io/library/postgres:12.1
environment:
POSTGRES_USER: "quay"
POSTGRES_PASSWORD: "quay"
POSTGRES_DB: "quay"
volumes:
- "./local-dev/init/pg_bootstrap.sql:/docker-entrypoint-initdb.d/pg_bootstrap.sql"
- "quay-db-data:/var/lib/postgresql/data"
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U quay -d quay"]
interval: 10s
timeout: 9s
retries: 3
start_period: 10s
clair-db:
user: postgres
container_name: clair-db
image: docker.io/library/postgres:12.1
command: -c 'max_connections=300'
environment:
POSTGRES_USER: "clair"
POSTGRES_DB: "clair"
volumes:
- "clair-db-data:/var/lib/postgresql/data"
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U clair -d clair"]
interval: 10s
timeout: 9s
retries: 3
start_period: 10s
cpus: 2
redis:
user: nobody
container_name: quay-redis
image: docker.io/library/redis:latest
ports:
- "6379:6379"
ldap:
container_name: quay-ldap
image: docker.io/389ds/dirsrv:latest
environment:
DS_DM_PASSWORD: "admin"
volumes:
- "./local-dev/ldap/base.ldif:/data/ldif/base.ldif:ro"
- "./local-dev/ldap/init-389ds.sh:/data/init-389ds.sh:ro"
ports:
- "3389:3389"
- "6636:3636"
command: >
bash -c "
/usr/lib/dirsrv/dscontainer -r &
sleep 10 &&
bash /data/init-389ds.sh &&
wait
"
local-dev-frontend:
user: ${DOCKER_USER:-root}
container_name: quay-local-dev-frontend
build:
context: .
target: build-static
image: localhost/quay-build:latest
init: true
volumes:
- ".:/quay-registry"
working_dir: /quay-registry
environment:
npm_config_cache: /quay-registry/.npm
entrypoint:
- sh
- -c
- npm run watch
local-dev-react:
user: ${DOCKER_USER:-root}
container_name: quay-local-dev-react
build:
context: .
args:
BUILD_ANGULAR: false
target: build-ui
image: localhost/quay-react:latest
volumes:
- ".:/quay-registry"
working_dir: /quay-registry
entrypoint:
- sh
- -c
- |
echo "Copying React files to host volume..."
mkdir -p static/patternfly
cp -r /opt/app-root/dist/* static/patternfly/
echo "React files ready for nginx"
tail -f /dev/null
quay:
user: ${DOCKER_USER:-nobody:0}
container_name: quay-quay
build:
context: .
args:
BUILD_ANGULAR: ${BUILD_ANGULAR:-true}
target: final
image: localhost/quay-local:latest
volumes:
- ".:/quay-registry"
- "./local-dev/stack:/quay-registry/conf/stack"
ports:
- "8080:8080"
- "8443:8443"
environment:
QUAY_VERSION: local-dev
QUAY_HOTRELOAD: "true"
DEBUGLOG: "true"
IGNORE_VALIDATION: "true"
QUAYRUN: /tmp
WORKER_COUNT_UNSUPPORTED_MINIMUM: "1"
WORKER_COUNT: "1"
repomirror:
user: ${DOCKER_USER:-nobody:0}
container_name: quay-repomirror
build:
context: .
args:
BUILD_ANGULAR: ${BUILD_ANGULAR:-true}
target: final
image: localhost/quay-local:latest
volumes:
- ".:/quay-registry"
- "./local-dev/stack:/quay-registry/conf/stack"
environment:
QUAY_VERSION: local-dev
QUAY_HOTRELOAD: "true"
DEBUGLOG: "true"
IGNORE_VALIDATION: "true"
QUAYRUN: /tmp
WORKER_COUNT_UNSUPPORTED_MINIMUM: "1"
WORKER_COUNT: "1"
command: ["repomirror-nomigrate"]
network_mode: "service:quay"
depends_on:
- quay-db
- redis
- quay
# clair is configured to share it's network
# namespace with quay. this allows quay to serve
# layers to clair over localhost.
clair:
user: ${DOCKER_USER:-nobody:0}
container_name: quay-clair
image: quay.io/projectquay/clair:4.7.2
volumes:
- "./local-dev/clair:/src/clair/"
environment:
CLAIR_CONF: "/src/clair/config.yaml"
CLAIR_MODE: "combo"
network_mode: "service:quay"
cpus: 2
command:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor ."]
# Mailpit - local email testing server
# Web UI: http://localhost:8025
mailpit:
container_name: quay-mailpit
image: docker.io/axllent/mailpit:latest
ports:
- "8025:8025" # Web UI
- "1025:1025" # SMTP
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1