Stream plugin file-tail logs through Run plan
This commit is contained in:
@@ -285,6 +285,42 @@ func TestCoreServiceAcceptsAutonomousRunLogStreamWithoutPlatformJob(t *testing.T
|
||||
}
|
||||
}
|
||||
|
||||
func TestCoreServiceAcceptsAutonomousRunFileTailLogStreamWithoutPlatformJob(t *testing.T) {
|
||||
svc, sessionToken := newRegisteredLogIngestService(t)
|
||||
entry := domain.LogEntry{Seq: 1, Timestamp: time.Date(2026, 7, 3, 12, 0, 1, 0, time.UTC), Level: "info", Line: "LogSCUM: Display: player joined"}
|
||||
streamID := runLogStreamID("run-local", "server-1", "scum.server")
|
||||
ack, err := svc.IngestLogBatch(domain.LogBatchIngest{
|
||||
RunEndpointID: "run-local",
|
||||
SessionToken: sessionToken,
|
||||
LogStreamID: streamID,
|
||||
ServerInstanceID: "server-1",
|
||||
StreamKey: "scum.server",
|
||||
Source: domain.LogStreamSourceFile,
|
||||
FirstSeq: entry.Seq,
|
||||
LastSeq: entry.Seq,
|
||||
Compression: "none",
|
||||
Checksum: validator.LogLineChecksum(entry.Line),
|
||||
Entries: []domain.LogEntry{entry},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("ingest autonomous run file-tail log batch: %v", err)
|
||||
}
|
||||
if !ack.Accepted || ack.LogStreamID != streamID || ack.LatestSeq != entry.Seq {
|
||||
t.Fatalf("unexpected autonomous file-tail stream ack: %+v", ack)
|
||||
}
|
||||
stream, err := svc.GetLogStream(streamID)
|
||||
if err != nil {
|
||||
t.Fatalf("get autonomous file-tail stream: %v", err)
|
||||
}
|
||||
if stream.ServerInstanceID != "server-1" || stream.StreamKey != "scum.server" || stream.Source != domain.LogStreamSourceFile {
|
||||
t.Fatalf("unexpected autonomous file-tail stream metadata: %+v", stream)
|
||||
}
|
||||
query, err := svc.QueryLogStream(domain.LogStreamCursorQuery{LogStreamID: streamID, AfterSeq: 0, Limit: 10})
|
||||
if err != nil || len(query.Entries) != 1 || query.Entries[0].Line != entry.Line {
|
||||
t.Fatalf("unexpected autonomous file-tail query: %+v err=%v", query, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCoreServiceAcceptsLegacyAutonomousJobLogStreamWithoutPlatformJob(t *testing.T) {
|
||||
svc, sessionToken := newRegisteredLogIngestService(t)
|
||||
entry := domain.LogEntry{Seq: 1, Timestamp: time.Date(2026, 7, 3, 12, 0, 1, 0, time.UTC), Level: "info", Line: "legacy autonomous bootstrap output"}
|
||||
|
||||
Reference in New Issue
Block a user