feat: T1016 dns_config probe + server-side drift detection + Crucible DNS DRIFT badge
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user