Expand test coverage across server, agent, and web; fix bugs found during audit.
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.
This commit is contained in:
25
agent/deploy/autospread_test.go
Normal file
25
agent/deploy/autospread_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user