Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
@@ -102,7 +102,7 @@ func TestFleetAIHandlerGetModels(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFleetAISnapshotOmitsAdaptiveWhenAIControl(t *testing.T) {
|
||||
func TestFleetAISnapshotSpreadTemperamentWhenAIControl(t *testing.T) {
|
||||
database, err := db.New(t.TempDir())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -111,7 +111,7 @@ func TestFleetAISnapshotOmitsAdaptiveWhenAIControl(t *testing.T) {
|
||||
|
||||
hub := NewWSHub(database)
|
||||
hub.SetAdaptiveEngine(strategy.NewAdaptiveEngine(database, true))
|
||||
hub.SetServerPolicy(ServerPolicy{AIControlEnabled: true})
|
||||
hub.SetServerPolicy(ServerPolicy{AIControlEnabled: true, AIPersona: fleetai.PersonaPersuasive})
|
||||
agentID := "snap-agent-1"
|
||||
_ = database.UpsertAgent(&models.Agent{
|
||||
ID: agentID, Name: "node-a", Platform: "windows", Status: "online",
|
||||
@@ -121,8 +121,11 @@ func TestFleetAISnapshotOmitsAdaptiveWhenAIControl(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatal("snapshot not found")
|
||||
}
|
||||
if snap.Adaptive != nil {
|
||||
t.Fatalf("adaptive must be nil when AI control enabled, got %+v", snap.Adaptive)
|
||||
if snap.Adaptive == nil || len(snap.Adaptive.TierOrder) == 0 {
|
||||
t.Fatalf("expected spread temperament in snapshot, got %+v", snap.Adaptive)
|
||||
}
|
||||
if snap.Adaptive.TierOrder[1] != "dns_txt" {
|
||||
t.Fatalf("persuasive spread order = %v", snap.Adaptive.TierOrder)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user