yao/sandbox/v2/testutils_containerized_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

37 lines
819 B
Go

//go:build containerized
package sandbox_test
import (
"fmt"
"os"
)
func init() {
extraNodeProviders = append(extraNodeProviders, containerizedNodes)
extraPurgeProviders = append(extraPurgeProviders, containerizedPurge)
}
func containerizedNodes() []nodeConfig {
host := os.Getenv("TAI_TEST_CONTAINERIZED_HOST")
if host == "" {
return nil
}
grpcPort := envPort("TAI_TEST_CONTAINERIZED_GRPC_PORT", 9200)
return []nodeConfig{{
Name: "containerized",
Addr: fmt.Sprintf("tai://%s:%d", host, grpcPort),
}}
}
func containerizedPurge() []purgeTarget {
host := os.Getenv("TAI_TEST_CONTAINERIZED_HOST")
if host == "" {
return nil
}
grpcPort := envPort("TAI_TEST_CONTAINERIZED_GRPC_PORT", 9200)
return []purgeTarget{{
name: "containerized",
addr: fmt.Sprintf("tai://%s:%d", host, grpcPort),
}}
}