todos-contra-el-fuego-web/docker-compose.e2e.yml
vjrj a3f2929ff7 test(e2e): browser suite for the flows the server tests cannot see
Playwright under e2e/, its own npm project so Meteor never sees the dependency
(.meteorignore keeps the directory out of the bundle — a config file at the app
root is otherwise eagerly loaded into the server and crashes it).

Covers what the phase asked for: sign up / log in, creating a zone from the map
and watching the union get painted on /subscriptions and /zones, removing it
again, commenting on a fire, and switching language. The zone spec is the flow
that froze staging on 2026-07-30 — it passes only if the server is still
answering DDP while the union is recomputed.

docker-compose.e2e.yml is a throwaway stack (Mongo on tmpfs, no named volume) so
the destructive seeds cannot be pointed at anything real by accident;
playwright.config.js refuses to start against the staging or production domains.

i18n.spec.js leaves a test.fixme on a real bug found while writing it: the
language chosen in the profile does not survive a page reload.
2026-08-01 18:44:09 +02:00

78 lines
2.8 KiB
YAML

# Stack EFÍMERO para la suite e2e (Playwright) y el smoke REST.
#
# ⚠️ Todo lo de aquí es desechable y se siembra BORRANDO colecciones
# (e2e/seed.js, smoke/seed.js). Por eso el Mongo va en tmpfs y sin volumen
# nombrado: no puede sobrevivir al `down`, y así no hay forma de que alguien lo
# confunda con el stack local (docker-compose.yml) ni con staging. NUNCA apuntes
# la suite a testfuegos.comunes.org.
#
# Uso:
# docker compose -f docker-compose.e2e.yml up -d --build
# E2E_BASE_URL=http://localhost:3300 npm --prefix e2e test
# docker compose -f docker-compose.e2e.yml down -v
#
# settings-ci.json se monta tal cual: no lleva secretos (ver el fichero).
name: tcef-e2e
services:
mongo:
image: mongo:7
# replSet aunque sea de un nodo: sin oplog, Meteor cae a polling cada 10s y
# la unión de zonas tardaría eso en llegar al navegador — justo lo que los
# tests miden.
command: ["--replSet", "rs0", "--bind_ip_all"]
tmpfs:
- /data/db
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
mongo-init:
image: mongo:7
depends_on:
mongo:
condition: service_healthy
restart: "no"
volumes:
- ./e2e/seed.js:/seed/e2e-seed.js:ro
entrypoint:
- bash
- -ec
- |
mongosh --host mongo --quiet --eval 'try { rs.status().ok } catch (e) { rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongo:27017"}]}) }'
for i in $$(seq 1 30); do
state=$$(mongosh --host mongo --quiet --eval 'try { rs.isMaster().ismaster } catch (e) { false }')
[ "$$state" = "true" ] && break
sleep 1
done
# Las migraciones históricas de Meteor (up() aún síncronos) se marcan
# como aplicadas, igual que en el compose local.
mongosh --host mongo --quiet fuegos --eval 'db.migrations.replaceOne({_id: "control"}, {_id: "control", version: 18, locked: false}, {upsert: true})'
mongosh --host mongo --quiet fuegos /seed/e2e-seed.js
echo "mongo-init: replica set + migraciones + seed OK"
web:
build:
context: .
dockerfile: Dockerfile
image: tcef-web:e2e
depends_on:
mongo-init:
condition: service_completed_successfully
environment:
PORT: "3000"
ROOT_URL: http://localhost:3300
MONGO_URL: mongodb://mongo:27017/fuegos?replicaSet=rs0
MONGO_OPLOG_URL: mongodb://mongo:27017/local?replicaSet=rs0
METEOR_SETTINGS_FILE: /run/settings-ci.json
# Usuarios de prueba (fixtures.js): el e2e crea los suyos, pero el smoke y
# la exploración manual esperan admin@admin.com / password.
TCEF_SEED: "1"
volumes:
- ./settings-ci.json:/run/settings-ci.json:ro
ports:
- "3300:3000"