parallel dev isolation #529

Merged
moritz merged 4 commits from feat/parallel-dev-isolation into main 2026-06-15 18:03:00 +02:00
5 changed files with 20 additions and 11 deletions

View file

@ -29,6 +29,9 @@ seed-database:
start-database: start-database:
docker compose up -d docker compose up -d
start-test-db:
docker compose up -d db
# Full check suite: lint + audit + the fast tests (slow/ui excluded). No Dialyzer. # Full check suite: lint + audit + the fast tests (slow/ui excluded). No Dialyzer.
ci-dev: install-dependencies lint audit test-fast ci-dev: install-dependencies lint audit test-fast

View file

@ -5,7 +5,7 @@ config :mv, Mv.Repo,
username: "postgres", username: "postgres",
password: "postgres", password: "postgres",
hostname: "localhost", hostname: "localhost",
port: 5000, port: String.to_integer(System.get_env("DB_PORT") || "5000"),
database: "mv_dev", database: "mv_dev",
stacktrace: true, stacktrace: true,
show_sensitive_data_on_connection_error: true, show_sensitive_data_on_connection_error: true,
@ -97,9 +97,9 @@ config :mv, :token_signing_secret, "IwUwi65TrEeExwBXXFPGm2I7889NsL"
# do not set defaults here so the SSO button stays hidden and no MissingSecret occurs. # do not set defaults here so the SSO button stays hidden and no MissingSecret occurs.
# config :mv, :oidc, # config :mv, :oidc,
# client_id: "mv", # client_id: "mv",
# base_url: "http://localhost:8080/auth/v1", # base_url: "http://localhost:#{System.get_env("RAUTHY_PORT") || "8080"}/auth/v1",
# client_secret: System.get_env("OIDC_CLIENT_SECRET"), # client_secret: System.get_env("OIDC_CLIENT_SECRET"),
# redirect_uri: "http://localhost:4000/auth/user/oidc/callback" # redirect_uri: "http://localhost:#{System.get_env("PORT") || "4000"}/auth/user/oidc/callback"
# AshAuthentication development configuration # AshAuthentication development configuration
config :mv, :session_identifier, :jti config :mv, :session_identifier, :jti

View file

@ -9,7 +9,7 @@ config :mv, Mv.Repo,
username: "postgres", username: "postgres",
password: "postgres", password: "postgres",
hostname: System.get_env("TEST_POSTGRES_HOST", "localhost"), hostname: System.get_env("TEST_POSTGRES_HOST", "localhost"),
port: System.get_env("TEST_POSTGRES_PORT", "5000"), port: System.get_env("TEST_POSTGRES_PORT") || System.get_env("DB_PORT") || "5000",
database: "mv_test#{System.get_env("MIX_TEST_PARTITION")}", database: "mv_test#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox, pool: Ecto.Adapters.SQL.Sandbox,
pool_size: System.schedulers_online() * 8, pool_size: System.schedulers_online() * 8,

View file

@ -12,19 +12,21 @@ services:
volumes: volumes:
- postgres-data:/var/lib/postgresql - postgres-data:/var/lib/postgresql
ports: ports:
- "5000:5432" - "${DB_PORT:-5000}:5432"
networks: networks:
- local - local
mailcrab: mailcrab:
image: marlonb/mailcrab:latest image: marlonb/mailcrab:latest
ports: ports:
- "1080:1080" - "${MAILCRAB_PORT:-1080}:1080"
networks: networks:
- rauthy-dev - rauthy-dev
rauthy: rauthy:
container_name: rauthy-dev # No fixed container_name — Compose derives it from COMPOSE_PROJECT_NAME so
# several isolated stacks coexist (e.g. mv-<issue>-rauthy-1). A plain
# checkout gets <dir>-rauthy-1.
image: ghcr.io/sebadob/rauthy:0.35.2 image: ghcr.io/sebadob/rauthy:0.35.2
environment: environment:
- LOCAL_TEST=true - LOCAL_TEST=true
@ -32,7 +34,8 @@ services:
- SMTP_PORT=1025 - SMTP_PORT=1025
- SMTP_DANGER_INSECURE=true - SMTP_DANGER_INSECURE=true
- LISTEN_SCHEME=http - LISTEN_SCHEME=http
- PUB_URL=localhost:8080 # Advertised URL must match the host-mapped port below.
- PUB_URL=localhost:${RAUTHY_PORT:-8080}
- BOOTSTRAP_ADMIN_PASSWORD_PLAIN=RauthyTest12345 - BOOTSTRAP_ADMIN_PASSWORD_PLAIN=RauthyTest12345
# Disable strict IP validation to allow access from multiple Docker networks # Disable strict IP validation to allow access from multiple Docker networks
- SESSION_VALIDATE_IP=false - SESSION_VALIDATE_IP=false
@ -40,7 +43,7 @@ services:
# Re-runs after `docker compose down -v` because the DB is empty again. # Re-runs after `docker compose down -v` because the DB is empty again.
- BOOTSTRAP_DIR=/app/bootstrap - BOOTSTRAP_DIR=/app/bootstrap
ports: ports:
- "8080:8080" - "${RAUTHY_PORT:-8080}:8080"
depends_on: depends_on:
- mailcrab - mailcrab
- db - db

View file

@ -117,8 +117,11 @@ defmodule Mv.MixProject do
defp dialyzer do defp dialyzer do
[ [
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}, # PLT paths are overridable so the pipeline can point all worktrees/clones
plt_core_path: "priv/plts/core.plt", # at a shared, machine-global PLT cache (avoids each rebuilding the PLT).
# Default to the in-repo priv/plts for a plain checkout.
plt_file: {:no_warn, System.get_env("PLT_LOCAL_PATH") || "priv/plts/dialyzer.plt"},
plt_core_path: System.get_env("PLT_CORE_PATH") || "priv/plts/core.plt",
plt_add_apps: [:mix, :ex_unit], plt_add_apps: [:mix, :ex_unit],
flags: [ flags: [
:error_handling, :error_handling,