Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions backend-api/__tests__/provisioning.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@ describe("provisioning runtime/gateway contracts", () => {
expect(fetchImpl.mock.calls[1][0]).toBe("http://host.docker.internal:19123/");
});

it("uses GATEWAY_HOST for published control-plane ports when provided", async () => {
process.env.GATEWAY_HOST = "gateway.external";
const fetchImpl = jest
.fn()
.mockResolvedValueOnce({ status: 200 })
.mockResolvedValueOnce({ status: 403 });

const readiness = await waitForAgentReadiness(
{ host: "agent.internal", gatewayHostPort: 19123 },
{
runtime: { attempts: 1, intervalMs: 1, timeoutMs: 1, fetchImpl },
gateway: { attempts: 1, intervalMs: 1, timeoutMs: 1, fetchImpl },
}
);

expect(readiness.ok).toBe(true);
expect(readiness.gateway.host).toBe("gateway.external");
expect(fetchImpl.mock.calls[1][0]).toBe("http://gateway.external:19123/");
});

it("honors explicit runtime and gateway host overrides", async () => {
const fetchImpl = jest
.fn()
Expand Down
Loading