TestBuildLogsData tests the structured data creation for logs
(t *testing.T)
| 14 | |
| 15 | // TestBuildLogsData tests the structured data creation for logs |
| 16 | func TestBuildLogsData(t *testing.T) { |
| 17 | tmpDir := testutil.TempDir(t, "test-*") |
| 18 | |
| 19 | // Create sample processed runs |
| 20 | processedRuns := []ProcessedRun{ |
| 21 | { |
| 22 | Run: WorkflowRun{ |
| 23 | DatabaseID: 12345, |
| 24 | Number: 1, |
| 25 | WorkflowName: "Test Workflow", |
| 26 | WorkflowPath: ".github/workflows/test-workflow.yml", |
| 27 | Status: "completed", |
| 28 | Conclusion: "success", |
| 29 | Duration: 5 * time.Minute, |
| 30 | TokenUsage: 1000, |
| 31 | Turns: 3, |
| 32 | ErrorCount: 0, |
| 33 | WarningCount: 1, |
| 34 | MissingToolCount: 0, |
| 35 | CreatedAt: time.Date(2024, 1, 1, 12, 0, 0, 0, time.UTC), |
| 36 | URL: "https://github.com/test/repo/actions/runs/12345", |
| 37 | LogsPath: filepath.Join(tmpDir, "run-12345"), |
| 38 | Event: "push", |
| 39 | HeadBranch: "main", |
| 40 | }, |
| 41 | TaskDomain: &TaskDomainInfo{ |
| 42 | Name: "triage", |
| 43 | Label: "Triage", |
| 44 | }, |
| 45 | BehaviorFingerprint: &BehaviorFingerprint{ |
| 46 | ExecutionStyle: "directed", |
| 47 | ToolBreadth: "narrow", |
| 48 | ActuationStyle: "read_only", |
| 49 | ResourceProfile: "lean", |
| 50 | DispatchMode: "standalone", |
| 51 | }, |
| 52 | AgenticAssessments: []AgenticAssessment{ |
| 53 | { |
| 54 | Kind: "overkill_for_agentic", |
| 55 | Severity: "low", |
| 56 | Summary: "Deterministic automation may be a better fit.", |
| 57 | }, |
| 58 | }, |
| 59 | MissingTools: []MissingToolReport{}, |
| 60 | MCPFailures: []MCPFailureReport{}, |
| 61 | }, |
| 62 | { |
| 63 | Run: WorkflowRun{ |
| 64 | DatabaseID: 12346, |
| 65 | Number: 2, |
| 66 | WorkflowName: "Test Workflow", |
| 67 | WorkflowPath: ".github/workflows/test-workflow.yml", |
| 68 | Status: "completed", |
| 69 | Conclusion: "failure", |
| 70 | Duration: 3 * time.Minute, |
| 71 | TokenUsage: 500, |
| 72 | Turns: 2, |
| 73 | ErrorCount: 1, |
nothing calls this directly
no test coverage detected