Align runtime profiles with plugin-owned records

This commit is contained in:
npc0-hue
2026-09-02 10:22:14 +08:00
parent 6018d8f0fc
commit a027ca70eb
36 changed files with 234 additions and 1590 deletions
+24
View File
@@ -0,0 +1,24 @@
package validator
import (
"strings"
"testing"
"time"
"browser.local/platform/domain"
)
func TestValidateLogBatchIngestAcceptsVerbatimBlankAndLongLines(t *testing.T) {
entries := []domain.LogEntry{
{Seq: 1, Timestamp: time.Date(2026, 9, 1, 0, 0, 0, 0, time.UTC), Line: ""},
{Seq: 2, Timestamp: time.Date(2026, 9, 1, 0, 0, 1, 0, time.UTC), Line: strings.Repeat("x", 32*1024)},
}
checksum, err := LogEntriesChecksum(entries)
if err != nil {
t.Fatalf("checksum: %v", err)
}
batch := domain.LogBatchIngest{RunEndpointID: "run-1", SessionToken: "session-1", LogStreamID: "run.run-1.server-1.stdout", ServerInstanceID: "server-1", StreamKey: "stdout", Source: domain.LogStreamSourceProcess, FirstSeq: 1, LastSeq: 2, Compression: "none", Checksum: checksum, Entries: entries}
if err := ValidateLogBatchIngest(batch); err != nil {
t.Fatalf("verbatim log batch was rejected: %v", err)
}
}