Skip to content

Run the test suite against both deployment modes (full and lean) in CI#154

Open
CarsonDavis wants to merge 1 commit into
tests-stale-fixesfrom
tests-both-modes-ci
Open

Run the test suite against both deployment modes (full and lean) in CI#154
CarsonDavis wants to merge 1 commit into
tests-stale-fixesfrom
tests-both-modes-ci

Conversation

@CarsonDavis

Copy link
Copy Markdown

What this does

MMGIS ships in two shapes from one codebase, selected by MMGIS_DEPLOYMENT_MODE: the full application, and a lean deployment that turns a set of server features off (geodata management, drawing, the bundled sidecar services, the on-disk mission filesystem, the link shortener, server-side raster utilities) and the dashboard publish flow on. Today CI exercises essentially one of those shapes — a change that breaks the other can pass CI and reach production.

This runs the e2e/boot suite once per shape and adds checks that verify the right features are present or absent in each mode, so a change that breaks either shape fails CI before merge. It's also the safety net for the planned (separate) gating-consolidation refactor, whose "no behavior change" claim is only trustworthy if the tests already run both modes.

Implements #151. Stacked on #149#150.

Changes

CI / test / docs only — no application or runtime source changed.

  • CI matrix. Split the workflow into a single hermetic unit job (Vitest, no DB/browser — it already covers both modes via require-cache busting, so it isn't matrixed) and a matrixed e2e job over mode: [full, lean]. The mode is written into .env and surfaced in the job name (e2e (full) / e2e (lean)) and per-mode artifact names.
  • Present/absent check (tests/e2e/deployment-mode.spec.js). A hand-written feature inventory (independent of any capability table — that independence is the point) asserting each full-only feature is reachable in full and gone in lean, and the lean-only dashboard publish flow the reverse. One loop covers both directions. Discriminator: a mounted route answers non-404; an unmounted one falls through to the catch-all 404. This step has no continue-on-error, so mis-gating a feature turns the leg red.
  • Tables-exist check (tests/ci/assert-gated-tables.js). Features gated off in a mode still have their DB tables (model sync is unconditional; only route mounts are gated), so a later mode flip needs no data migration. Asserted via the same getBackendSetups + sync path the server uses.
  • Honest lean leg. The lean leg disables the sidecar WITH_* flags so init-db and boot succeed without the services lean doesn't deploy (no sidecars, no spatial-catalog DB).
  • Short contributor note in README.md + AGENTS.md: two modes exist; author in full first, then confirm lean.

Verification

Booted both modes locally and ran the new checks:

Check full lean
present/absent spec (8 features) ✅ 8/8 ✅ 8/8
app boots ✅ (sidecar spawner + proxy disabled, no STAC DB)
gated tables exist ✅ (6 table groups, fresh DB)

Full-only routes return non-404 in full / 404 in lean; /api/deployments (publish flow) is the reverse. npx vitest run stays green (669/669).

Notes for reviewers

#151)

Add a [full, lean] deployment-mode matrix to the e2e/boot CI leg and the
checks that make a mode-specific break fail CI before merge:

- Split CI into a single hermetic unit job (vitest) and a matrixed e2e
  job; surface the mode in job and artifact names.
- New tests/e2e/deployment-mode.spec.js: a hand-written feature inventory
  asserting each full-only feature is reachable in full and gone in lean,
  and the lean-only dashboard publish flow the reverse. One loop covers
  both directions. The gating step has no continue-on-error, so a
  mis-gated feature turns the leg red (acceptance #5).
- New tests/ci/assert-gated-tables.js: gated-off features still have their
  DB tables in each mode (model sync is unconditional; only route mounts
  are gated), so a later mode flip needs no data migration (acceptance #4).
- Lean leg disables the sidecar WITH_* flags so init-db and boot succeed
  without the services lean doesn't deploy (acceptance #3).
- Short two-mode contributor note in README and AGENTS (author in full
  first, then confirm lean).

No application/runtime source changes. Verified locally: both legs' spec
passes 8/8, lean boots sidecar-free, and the gated tables exist in lean.
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we upgrade this version?

@CarsonDavis

Copy link
Copy Markdown
Author

Question: what are the ramifications of having the lean tests be the baseline tests and then the full tests import them? will that be cleaner than the current strategy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants