(t *testing.T)
| 846 | } |
| 847 | |
| 848 | func TestBuildAuditDataMinimal(t *testing.T) { |
| 849 | // Test with minimal/empty data |
| 850 | processedRun := ProcessedRun{ |
| 851 | Run: WorkflowRun{ |
| 852 | DatabaseID: 1, |
| 853 | WorkflowName: "Minimal", |
| 854 | Status: "completed", |
| 855 | Conclusion: "success", |
| 856 | LogsPath: "/nonexistent", |
| 857 | }, |
| 858 | } |
| 859 | |
| 860 | metrics := workflow.LogMetrics{} |
| 861 | |
| 862 | auditData := buildAuditData(processedRun, metrics, nil) |
| 863 | |
| 864 | // Should still produce valid data |
| 865 | assert.Equal(t, int64(1), auditData.Overview.RunID, |
| 866 | "RunID should match even with minimal data") |
| 867 | |
| 868 | // Empty slices should be nil or empty, not cause panics |
| 869 | // We just want to ensure no panics occur accessing these fields |
| 870 | _ = auditData.Jobs |
| 871 | } |
| 872 | |
| 873 | func TestBuildAuditDataFallbackMetricsWithoutAwInfo(t *testing.T) { |
| 874 | tmpDir := testutil.TempDir(t, "audit-fallback-*") |
nothing calls this directly
no test coverage detected