Improve portable launch, forge persistence, and operator auth UX.
Persist build extra_files for Build Manager history, print dashboard login on every start, add libp2p for Mesh P2P forge, defer WebSocket until login, and split devrun.bat from LAUNCH.bat with USB deck auto-detection.
This commit is contained in:
39
server/internal/api/agent_config_test.go
Normal file
39
server/internal/api/agent_config_test.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package api
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestAgentConfigPoolHostOrDefault(t *testing.T) {
|
||||
t.Run("empty uses fallback", func(t *testing.T) {
|
||||
cfg := AgentForgeConfig{}
|
||||
if got := cfg.poolHostOrDefault("fallback.host"); got != "fallback.host" {
|
||||
t.Fatalf("got %q, want fallback.host", got)
|
||||
}
|
||||
})
|
||||
t.Run("explicit host wins", func(t *testing.T) {
|
||||
cfg := AgentForgeConfig{PoolHost: "pool.example.com"}
|
||||
if got := cfg.poolHostOrDefault("fallback"); got != "pool.example.com" {
|
||||
t.Fatalf("got %q, want pool.example.com", got)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestAgentConfigPoolPortOrDefault(t *testing.T) {
|
||||
t.Run("zero uses fallback", func(t *testing.T) {
|
||||
cfg := AgentForgeConfig{}
|
||||
if got := cfg.poolPortOrDefault(3333); got != 3333 {
|
||||
t.Fatalf("got %d, want 3333", got)
|
||||
}
|
||||
})
|
||||
t.Run("negative uses fallback", func(t *testing.T) {
|
||||
cfg := AgentForgeConfig{PoolPort: -1}
|
||||
if got := cfg.poolPortOrDefault(3333); got != 3333 {
|
||||
t.Fatalf("got %d, want 3333", got)
|
||||
}
|
||||
})
|
||||
t.Run("explicit port wins", func(t *testing.T) {
|
||||
cfg := AgentForgeConfig{PoolPort: 443}
|
||||
if got := cfg.poolPortOrDefault(3333); got != 443 {
|
||||
t.Fatalf("got %d, want 443", got)
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user