todos-contra-el-fuego-web/smoke/smoke.sh
vjrj 8fa10e47c7 WIP: Meteor 2.5 -> 3.1 migration (package resolution done; build blocked)
Reaches release METEOR@3.1 with all package-version conflicts resolved against a
modern dockerized MongoDB 7 (replica set). NOT yet building — parked here.

Done:
- MongoDB 7 single-node replica set (docker, port 27019) as the fuegos DB,
  decoupled from the shared rsmain 3.2 (unblocks Meteor 3's mongodb driver).
- meteor update --release 3.1 resolves after swapping dead packages:
  mongo-livedata removed; facts -> facts-base; saucecode:timezoned-synced-cron
  -> quave:synced-cron; aldeed:collection2-core -> aldeed:collection2@4.0.4;
  mys:fonts removed (pinned caching-compiler@1.0.0); fourseven:scss 4.14.1 ->
  5.0.0 (Dart Sass, no node-sass) + sass installed; nimble-restivus vendored
  package loosened to accounts-password 2.x||3.x.
- Network: meteor-tool node 22 needs NODE_OPTIONS='--dns-result-order=ipv4first
  --no-network-family-autoselection' to reach warehouse.meteor.com (Happy
  Eyeballs picks an unreachable IPv6 otherwise).
- smoke/smoke.sh generalized to mongosh + configurable port for Mongo 7.

Blocked on (remaining Meteor 3 work):
1. Client bundle linker: 'Runtime is not available, but it uses features needing
   the runtime: underscore' — an old client atmosphere package needs replacing.
2. Server async/await migration (Rest.js + helpers + methods + publications +
   comments + subsUnion + migrations to *Async; no Fibers).
3. Patch vendored restivus to await async endpoint handlers.
4. cron.js SyncedCron import (quave), facts.js Facts import (facts-base).
5. React 16 -> 18 render root (createRoot).
6. SCSS @import/@use + lighten/darken -> color.adjust (dart-sass deprecations).
2026-07-13 23:25:29 +02:00

32 lines
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
# Seed the dev Mongo deterministically and run the REST smoke test.
#
# smoke/smoke.sh # compare against committed baseline snapshots
# smoke/smoke.sh --update # (re)generate the baseline snapshots
#
# Env overrides:
# MONGO_CONTAINER docker container running the dev Mongo (default tcef-mongo7)
# MONGO_DB database name (default fuegos)
# MONGO_SHELL mongosh (Mongo 5+) or mongo (Mongo <5) (default mongosh)
# MONGO_PORT port mongod listens on inside the container (default 27019)
# BASE_URL dev server URL (default http://localhost:3100)
#
# Mongo 3.2 (Meteor ≤ 2.5) parity example:
# MONGO_CONTAINER=tcef-mongo32 MONGO_SHELL=mongo MONGO_PORT=27017 smoke/smoke.sh
set -euo pipefail
cd "$(dirname "$0")/.."
MONGO_CONTAINER="${MONGO_CONTAINER:-tcef-mongo7}"
MONGO_DB="${MONGO_DB:-fuegos}"
MONGO_SHELL="${MONGO_SHELL:-mongosh}"
MONGO_PORT="${MONGO_PORT:-27019}"
echo "== Seeding ${MONGO_DB} in ${MONGO_CONTAINER} (${MONGO_SHELL}:${MONGO_PORT}) =="
# Copy the script in and run it as a whole file: the shell evaluates a file
# argument atomically (piping via stdin is line-by-line and breaks on multi-line
# comments / var scope).
docker cp smoke/seed.js "${MONGO_CONTAINER}:/tmp/tcef-seed.js"
docker exec "${MONGO_CONTAINER}" "${MONGO_SHELL}" --port "${MONGO_PORT}" "${MONGO_DB}" /tmp/tcef-seed.js | tail -1
echo "== Running REST smoke test against ${BASE_URL:-http://localhost:3100} =="
node smoke/run.js "$@"