Files
mesh-catalog/modules/home-assistant/test/manifest.test.ts
T
jochen 4193eacec4
mesh/merge-gate head 4193eacec459 merged into trunk 39e7a06e6293 — pass: builds grafana, home-assistant → ace; no bus step; every machine composes with the…
mesh/repo-check head 4193eacec459 merged into trunk 39e7a06e6293 — pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-…
mesh/delivery delivered
Mark grafana's and home-assistant's soft requirements optional (hq issue 166, ADR 0330)
grafana runs without influxdb and home-assistant without the Servarr apps or a broker, yet a mesh
without them could not assign either. Their requirements are now optional: bound when a provider
runs, absent otherwise, with nothing installed for them. grafana's data source and its credential are
delivered only while influxdb-api is bound, into directories it mounts, so an absent file never
becomes a directory docker made in its place.
2026-10-13 00:41:30 +02:00

21 lines
1005 B
TypeScript

// Home Assistant runs without the Servarr apps and without a broker, so those requirements are optional
// (novox/hq ADR 0330, issue 166): a mesh without lidarr or an MQTT broker can assign home-assistant, and
// nothing is installed for it. Its provisions step already reads a binding that is not there as absent.
import { test } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
type Requirement = string | { name: string; optional?: boolean };
const manifest = JSON.parse(readFileSync(new URL("../module.json", import.meta.url), "utf8")) as { requires: Requirement[] };
test("the Servarr APIs and mqtt-topic are optional, and route stays hard", () => {
for (const name of ["sonarr-api", "radarr-api", "lidarr-api", "mqtt-topic"]) {
assert.ok(
manifest.requires.some((r) => typeof r !== "string" && r.name === name && r.optional === true),
`${name} is not optional`,
);
}
assert.ok(manifest.requires.includes("route"));
});