yao/sandbox/v2/testutils_remote_test.go
Max 7cccf62841 feat(tai): refactor Dial* functions and remove requireKubeConfig hard-fail
- Consolidate DialRemote/DialTunnel common logic into buildResources + dialEnv interface
- Remove strict capability check that prevented ConnResources creation for host-exec-only nodes
- Merge gRPC-discovered capabilities with registration-declared capabilities in DialTunnel
- Replace requireKubeConfig hard-fail with graceful skip when kubeconfig is absent
- Introduce tai/types package for shared Ports/Capabilities/SystemInfo/AuthInfo/NodeMeta
- Add tai/conn.go (ConnResources) and tai/dial.go (DialRemote/DialTunnel/DialLocal)
- Rename tai/sandbox → tai/runtime for clarity
- Update sandbox/v2, workspace, agent/sandbox/v2 test utilities for build-tag isolation

Made-with: Cursor
2026-03-12 15:44:24 +08:00

39 lines
845 B
Go

//go:build remote
package sandbox_test
import (
"os"
"strings"
)
func init() {
extraNodeProviders = append(extraNodeProviders, remoteNodes)
extraHostExecProviders = append(extraHostExecProviders, remoteHostExec)
extraPurgeProviders = append(extraPurgeProviders, remotePurge)
}
func remoteNodes() []nodeConfig {
addr := os.Getenv("SANDBOX_TEST_REMOTE_ADDR")
if addr == "" {
return nil
}
return []nodeConfig{{Name: "remote", Addr: addr}}
}
func remoteHostExec() []hostExecTarget {
addr := os.Getenv("SANDBOX_TEST_REMOTE_ADDR")
if addr == "" {
return nil
}
addr = strings.TrimPrefix(addr, "tai://")
return []hostExecTarget{{Name: "remote", Addr: addr}}
}
func remotePurge() []purgeTarget {
addr := os.Getenv("SANDBOX_TEST_REMOTE_ADDR")
if addr == "" {
return nil
}
return []purgeTarget{{name: "remote", addr: addr}}
}