MCPcopy Create free account
hub / github.com/github/gh-aw / TestRenderJSON

Function TestRenderJSON

pkg/cli/audit_test.go:329–433  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

327}
328
329func TestRenderJSON(t *testing.T) {
330 // Create test audit data
331 auditData := AuditData{
332 Overview: OverviewData{
333 RunID: 123456,
334 WorkflowName: "Test Workflow",
335 Status: "completed",
336 Conclusion: "success",
337 Event: "push",
338 Branch: "main",
339 URL: "https://github.com/org/repo/actions/runs/123456",
340 },
341 Metrics: MetricsData{
342 TokenUsage: 1500,
343 Turns: 5,
344 ErrorCount: 1,
345 WarningCount: 1,
346 },
347 Jobs: []JobData{
348 {
349 Name: "test-job",
350 Status: "completed",
351 Conclusion: "success",
352 Duration: "2m30s",
353 },
354 },
355 DownloadedFiles: []FileInfo{
356 {
357 Path: "aw_info.json",
358 Size: 1024,
359 Description: "Engine configuration and workflow metadata",
360 },
361 },
362 MissingTools: []MissingToolReport{
363 {
364 Tool: "missing_tool",
365 Reason: "Tool not available",
366 },
367 },
368 Errors: []ErrorInfo{
369 {
370 File: "agent.log",
371 Line: 42,
372 Type: "error",
373 Message: "Test error",
374 },
375 },
376 Warnings: []ErrorInfo{
377 {
378 File: "agent.log",
379 Line: 50,
380 Type: "warning",
381 Message: "Test warning",
382 },
383 },
384 }
385
386 // Render to JSON

Callers

nothing calls this directly

Calls 4

renderJSONFunction · 0.85
CloseMethod · 0.65
StringMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected