Correct artifact path bookkeeping
This commit is contained in:
@@ -113,6 +113,31 @@ func TestNewGenerateSummaryOmitsNotificationWhenNotAttempted(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewGenerateSummaryOmitsUnreachedArtifactPaths(t *testing.T) {
|
||||
result := &app.ReportResult{
|
||||
DataPackagePath: "/runs/daily/data_package.yaml",
|
||||
PreparationPath: "/runs/daily/preparation.json",
|
||||
Metadata: state.Metadata{
|
||||
ReportID: report.Daily,
|
||||
RunID: "20260529T133000Z_daily",
|
||||
},
|
||||
}
|
||||
|
||||
data, err := json.Marshal(newGenerateSummary(result, errors.New("metadata write failed")))
|
||||
if err != nil {
|
||||
t.Fatalf("Marshal() error = %v", err)
|
||||
}
|
||||
text := string(data)
|
||||
for _, omitted := range []string{"executionPath", "reportPath", "outputPath", "metadataPath", "generatedTextRawPath", "generatedTextPath", "renderContextPath", "notificationPath"} {
|
||||
if strings.Contains(text, omitted) {
|
||||
t.Fatalf("partial summary includes unreached field %q:\n%s", omitted, text)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(text, "dataPackagePath") || !strings.Contains(text, "preparationPath") {
|
||||
t.Fatalf("partial summary omits reached paths:\n%s", text)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewGenerateSummaryForNotificationFailure(t *testing.T) {
|
||||
generatedAt := time.Date(2026, 5, 29, 13, 30, 0, 0, time.UTC)
|
||||
result := &app.ReportResult{
|
||||
|
||||
Reference in New Issue
Block a user