Version 1 of 2 · · d2 (moved from d2spec) · in person · Current version

name
d3-f-impl-mongo
description
MongoDB — the store behind an implementation: when suites use it, and which database a run may touch. Get skills only from /api/v2/skills/d3.
feature
impl
concepts
[mongo]
tags
#skill #feature #d3skill #wip
project
d2spec

d3-f-impl-mongo

Intro

MongoDB: the store, and which database a run may touch.

What a builder needs on an implementation that keeps its data in MongoDB. Which classes live there is the model's choice (d3-f-data › inventory_choose). Implementations: d3-f-impl.

Essentials

  • R-mongo-1 NEVER point a run at a database that holds real data, or at one you didn't start for the run.
  • R-mongo-2 A suite that needs MongoDB skips without it: a skip is not a pass — say it in your summary.

Concepts

mongo

The implementation's database. Fields: D2_MONGO_URL (where a run finds it; a suite that needs it skips when it's unset); a file-backed stand-in for tests (D2_MONGO_URL=fake:<file>).

mongo_test

  • Summary: store code is tested on the stand-in; the real-database suites run on the replica at a release.
  • When: you changed code that reads or writes the store.
  • Needs: —
  • Call: D2_MONGO_URL=fake:<file> <testBasic> in <implDir> — the suites that need a database run against the stand-in.
  • Rules: R-mongo-1, R-mongo-2. You never need a MongoDB of your own: the tests against a real one are part of the release's full-setup check.
  • Errors: —
  • Gotchas: —

mongo_url

  • Summary: D2_MONGO_URL says which database; unset means the suites that need one skip.
  • When: a store suite skipped, or ran against something you didn't expect.
  • Needs: —
  • Call: echo "D2_MONGO_URL: ${D2_MONGO_URL:+set}" — whether it is set, never its value (it carries a password).
  • Rules: R-mongo-1.
  • Errors: —
  • Gotchas: —