fix(deploy): make clone installer build dependencies reliably

This commit is contained in:
姚章浩
2026-09-11 11:20:27 +08:00
parent f533c385ea
commit 9871760bc0
4 changed files with 22 additions and 1 deletions
+17
View File
@@ -177,3 +177,20 @@ func TestRootDockerInstallerIsCloneAndRunEntryPoint(t *testing.T) {
t.Fatal("root installer must not require an operator supplied DOBOTAI_IMAGE")
}
}
func TestRootDockerInstallerBuildsWithInternalGoModuleProxy(t *testing.T) {
installer, err := os.ReadFile("../install-docker.sh")
if err != nil {
t.Fatal(err)
}
dockerfile, err := os.ReadFile("../Dockerfile")
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(installer), "GOPROXY=https://goproxy.cn,direct") {
t.Fatal("root installer must pass an internal default GOPROXY to docker build")
}
if !strings.Contains(string(dockerfile), "ARG GOPROXY") || !strings.Contains(string(dockerfile), "GOPROXY=$GOPROXY go mod download") {
t.Fatal("Dockerfile must accept and use the root installer GOPROXY")
}
}