Skip to content

Commit b9867ca

Browse files
committed
feat(test-suite): warn user when selecting services that share a database
1 parent 3dca800 commit b9867ca

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

test-suite/fhevm/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ Use the short service suffix after the colon (e.g., `host-listener` not `coproce
180180
Multiple services are comma-separated. Services that share a Docker image are automatically
181181
co-selected (e.g., `host-listener` includes `host-listener-poller`).
182182

183+
> **Note:** `coprocessor` and `kms-connector` services share a database. Per-service overrides
184+
> work when your local changes don't include DB migrations. If your changes add or alter
185+
> migrations, non-overridden services will fail against the mismatched schema — use
186+
> `--override coprocessor` (full group) instead.
187+
183188
Available suffixes per group:
184189

185190
| Group | Suffixes |

test-suite/fhevm/src/layout.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ for (const group of SIBLING_GROUPS) {
125125
}
126126
}
127127

128+
/** Groups where all services share a database — per-service override requires schema compatibility. */
129+
export const SCHEMA_COUPLED_GROUPS: OverrideGroup[] = ["coprocessor", "kms-connector"];
130+
128131
export const suffixToServiceName = (group: OverrideGroup, suffix: string): string => {
129132
const fullName = GROUP_PREFIX[group] + suffix;
130133
if (!GROUP_BUILD_SERVICES[group].includes(fullName)) {

test-suite/fhevm/src/runtime.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
COMPONENT_BY_STEP,
1818
COMPONENTS,
1919
GROUP_SERVICE_SUFFIXES,
20+
SCHEMA_COUPLED_GROUPS,
2021
LOCK_DIR,
2122
LOG_TARGETS,
2223
PORTS,
@@ -615,6 +616,15 @@ const printPlan = (state: Pick<State, "target" | "overrides" | "topology">, from
615616
log(`[plan] target=${state.target}`);
616617
if (state.overrides.length) {
617618
log(`[plan] overrides=${state.overrides.map(describeOverride).join(", ")}`);
619+
for (const o of state.overrides) {
620+
if (o.services?.length && SCHEMA_COUPLED_GROUPS.includes(o.group)) {
621+
log(
622+
`[warn] ${o.group}: per-service override with a shared database. ` +
623+
`If your changes include DB migrations, non-overridden services may fail. ` +
624+
`Use --override ${o.group} (full group) in that case.`,
625+
);
626+
}
627+
}
618628
}
619629
log(`[plan] topology=n${state.topology.count}/t${state.topology.threshold}`);
620630
log(`[plan] steps=${STEP_NAMES.slice(stateStepIndex(fromStep ?? STEP_NAMES[0])).join(" -> ")}`);

0 commit comments

Comments
 (0)