mirror of
https://github.com/redwoodjs/local-ci.git
synced 2026-09-19 07:54:29 +08:00
c3316730b3
* Harden Rust orchestration parity * fix(ci): avoid nested rust buildx smoke hang * fix(ci): skip nested pause smoke in rust parity * test(rust): cover detached pause launcher * feat(rust): expand reusable workflows in parity * chore(ci): instrument rust smoke parity * fix(dtu): advertise container ip for nested runners * chore(ci): add rust smoke status diagnostics * fix(runner): attach nested runners to parent network * chore(ci): retrigger pr checks * fix(rust): clean nested network endpoints
34 lines
959 B
TypeScript
34 lines
959 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveContainerHostForEnv } from "./ephemeral.ts";
|
|
|
|
describe("resolveContainerHostForEnv", () => {
|
|
it("uses configured DTU host outside Docker", () => {
|
|
expect(
|
|
resolveContainerHostForEnv({
|
|
configuredHost: "10.1.0.1",
|
|
isInsideDocker: false,
|
|
}),
|
|
).toBe("10.1.0.1");
|
|
});
|
|
|
|
it("uses this container's IP inside Docker instead of inherited DTU host", () => {
|
|
expect(
|
|
resolveContainerHostForEnv({
|
|
configuredHost: "host.docker.internal",
|
|
containerIp: "172.18.0.4",
|
|
isInsideDocker: true,
|
|
}),
|
|
).toBe("172.18.0.4");
|
|
});
|
|
|
|
it("falls back to bridge gateway inside Docker when the container IP is unavailable", () => {
|
|
expect(
|
|
resolveContainerHostForEnv({
|
|
configuredHost: "host.docker.internal",
|
|
bridgeGateway: "172.19.0.1",
|
|
isInsideDocker: true,
|
|
}),
|
|
).toBe("172.19.0.1");
|
|
});
|
|
});
|