feat: T1016 dns_config probe + server-side drift detection + Crucible DNS DRIFT badge

This commit is contained in:
AetherForge
2026-05-30 23:26:50 -07:00
parent 6704933568
commit d005d5d07c
48 changed files with 4621 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ package db
import (
"database/sql"
"errors"
"strings"
"testing"
"time"
@@ -92,6 +93,24 @@ func TestSetPinnedBuild(t *testing.T) {
}
}
func TestSetPinnedBuildUnknownID(t *testing.T) {
d := openTestDB(t)
now := time.Now()
insertBuild(t, d, &models.BuildRecord{ID: "b1", WorkerName: "w", ServerURL: "u", Wallet: "w", CreatedAt: now, Pinned: true})
err := d.SetPinnedBuild("missing")
if err == nil {
t.Fatal("expected error for unknown build id")
}
if !strings.Contains(err.Error(), "not found") {
t.Fatalf("unexpected error: %v", err)
}
b1, _ := d.GetBuild("b1")
if b1.Pinned {
t.Fatal("unknown id should leave builds unpinned, not keep prior pin")
}
}
func TestGetLatestBuildForPlatform(t *testing.T) {
d := openTestDB(t)
base := time.Now().UTC().Truncate(time.Second)