mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 18:20:22 +00:00
refactor(daemon): share service description resolve
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
GATEWAY_WINDOWS_TASK_NAME,
|
||||
resolveGatewayLaunchAgentLabel,
|
||||
resolveGatewayProfileSuffix,
|
||||
resolveGatewayServiceDescription,
|
||||
resolveGatewaySystemdServiceName,
|
||||
resolveGatewayWindowsTaskName,
|
||||
} from "./constants.js";
|
||||
@@ -196,3 +197,23 @@ describe("formatGatewayServiceDescription", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveGatewayServiceDescription", () => {
|
||||
it("prefers explicit description override", () => {
|
||||
expect(
|
||||
resolveGatewayServiceDescription({
|
||||
env: { OPENCLAW_PROFILE: "work", OPENCLAW_SERVICE_VERSION: "1.0.0" },
|
||||
description: "Custom",
|
||||
}),
|
||||
).toBe("Custom");
|
||||
});
|
||||
|
||||
it("resolves version from explicit environment map", () => {
|
||||
expect(
|
||||
resolveGatewayServiceDescription({
|
||||
env: { OPENCLAW_PROFILE: "work", OPENCLAW_SERVICE_VERSION: "local" },
|
||||
environment: { OPENCLAW_SERVICE_VERSION: "remote" },
|
||||
}),
|
||||
).toBe("OpenClaw Gateway (profile: work, vremote)");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user