Unify §3 test overlaps (todo §3); fold the 5× image-pin checks into one compose.test.ts scan + same-version sidecar test, drop the duplicate committed-JWKS re-validation in config.test.ts
This commit is contained in:
+4
-14
@@ -1,8 +1,7 @@
|
||||
// Guards the Ory Hydra config (§3): image pinned to an exact version (AGENTS.md),
|
||||
// migrations run before the server (hydra-migrate → hydra), the DSN targets the hydra
|
||||
// database, the server listens on the public/admin ports, and the issuer +
|
||||
// login/consent/logout URLs point at our app. Real boot is verified by running the
|
||||
// stack; this catches edits.
|
||||
// Guards the Ory Hydra config (§3): migrations run before the server (hydra-migrate →
|
||||
// hydra), the DSN targets the hydra database, the server listens on the public/admin
|
||||
// ports, and the issuer + login/consent/logout URLs point at our app. Version pinning is
|
||||
// in compose.test.ts. Real boot is verified by running the stack; this catches edits.
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
@@ -11,15 +10,6 @@ const read = (p: string) => readFileSync(new URL(`../${p}`, import.meta.url), "u
|
||||
const compose = read("compose.yml");
|
||||
const hydraYml = read("ory/hydra/hydra.yml");
|
||||
|
||||
test("compose pins both hydra services to one exact version", () => {
|
||||
const tags = [...compose.matchAll(/image:\s*oryd\/hydra:(\S+)/g)].map((m) => m[1]);
|
||||
assert.equal(tags.length, 2, "hydra + hydra-migrate both present");
|
||||
assert.equal(tags[0], tags[1], "both pinned to the same version");
|
||||
const tag = tags[0]!;
|
||||
assert.match(tag, /^v\d+\.\d+\.\d+$/, `${tag} is an exact vMAJOR.MINOR.PATCH`);
|
||||
assert.doesNotMatch(tag, /latest|[\^~*]/, `${tag} is exact, not floating`);
|
||||
});
|
||||
|
||||
test("hydra migrations run once before the server starts", () => {
|
||||
assert.ok((compose.match(/migrate sql -e --yes/g) ?? []).length >= 2,
|
||||
"hydra-migrate runs SQL migrations (alongside kratos)");
|
||||
|
||||
Reference in New Issue
Block a user