Remove legacy daily report references
This commit is contained in:
@@ -19,7 +19,7 @@ func TestRenderConstructsCommand(t *testing.T) {
|
||||
}
|
||||
|
||||
result, err := runner.Render(context.Background(), RenderRequest{
|
||||
PromptID: "weather.daily_report",
|
||||
PromptID: "weather.markdown_report",
|
||||
DataPackagePath: "/tmp/data_package.yaml",
|
||||
})
|
||||
if err != nil {
|
||||
@@ -30,7 +30,7 @@ func TestRenderConstructsCommand(t *testing.T) {
|
||||
"render",
|
||||
"--config", "/etc/scriptorium.yml",
|
||||
"--profile", "weather",
|
||||
"--prompt", "weather.daily_report",
|
||||
"--prompt", "weather.markdown_report",
|
||||
"--input", "data_package=/tmp/data_package.yaml",
|
||||
"--format", "json",
|
||||
}
|
||||
@@ -56,7 +56,7 @@ func TestRenderReturnsResultForNonzeroExit(t *testing.T) {
|
||||
}
|
||||
|
||||
result, err := runner.Render(context.Background(), RenderRequest{
|
||||
PromptID: "weather.daily_report",
|
||||
PromptID: "weather.markdown_report",
|
||||
DataPackagePath: "/tmp/data_package.yaml",
|
||||
})
|
||||
if err == nil {
|
||||
@@ -84,7 +84,7 @@ func TestRunConstructsCommand(t *testing.T) {
|
||||
}
|
||||
|
||||
result, err := runner.Run(context.Background(), RunRequest{
|
||||
PromptID: "weather.daily_report",
|
||||
PromptID: "weather.markdown_report",
|
||||
DataPackagePath: "/tmp/data_package.yaml",
|
||||
OutputPath: "/tmp/daily.md",
|
||||
})
|
||||
@@ -96,7 +96,7 @@ func TestRunConstructsCommand(t *testing.T) {
|
||||
"run",
|
||||
"--config", "/etc/scriptorium.yml",
|
||||
"--profile", "weather",
|
||||
"--prompt", "weather.daily_report",
|
||||
"--prompt", "weather.markdown_report",
|
||||
"--input", "data_package=/tmp/data_package.yaml",
|
||||
"--out", "/tmp/daily.md",
|
||||
}
|
||||
@@ -129,7 +129,7 @@ func TestRunReturnsResultForValidationExit(t *testing.T) {
|
||||
}
|
||||
|
||||
result, err := runner.Run(context.Background(), RunRequest{
|
||||
PromptID: "weather.daily_report",
|
||||
PromptID: "weather.markdown_report",
|
||||
DataPackagePath: "/tmp/data_package.yaml",
|
||||
OutputPath: "/tmp/daily.md",
|
||||
})
|
||||
|
||||
@@ -314,6 +314,7 @@ func TestValidateReportModuleKeysWithoutMutatingOptions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestValidateReportModuleAliasesDirectly(t *testing.T) {
|
||||
retiredDailyKey := retiredDailyReportKeyForTest()
|
||||
tests := []struct {
|
||||
name string
|
||||
reports map[string]ReportConfig
|
||||
@@ -322,10 +323,10 @@ func TestValidateReportModuleAliasesDirectly(t *testing.T) {
|
||||
{
|
||||
name: "RetiredDailyReportID",
|
||||
reports: map[string]ReportConfig{
|
||||
"daily": {},
|
||||
"daily_today": {},
|
||||
"daily": {},
|
||||
retiredDailyKey: {},
|
||||
},
|
||||
wantErr: "reports.daily_today",
|
||||
wantErr: "reports." + retiredDailyKey,
|
||||
},
|
||||
{
|
||||
name: "TodayAndDailyAreDistinct",
|
||||
@@ -381,6 +382,7 @@ func TestReportModuleOverridesRejectsInvalidReportKeys(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestReportModuleOverrideValidation(t *testing.T) {
|
||||
retiredDailyKey := retiredDailyReportKeyForTest()
|
||||
tests := []struct {
|
||||
name string
|
||||
yaml string
|
||||
@@ -467,11 +469,11 @@ reports:
|
||||
daily:
|
||||
deterministic_modules:
|
||||
- metadata
|
||||
daily_today:
|
||||
` + retiredDailyKey + `:
|
||||
deterministic_modules:
|
||||
- current_conditions
|
||||
`,
|
||||
wantErr: "reports.daily_today",
|
||||
wantErr: "reports." + retiredDailyKey,
|
||||
},
|
||||
{
|
||||
name: "HourlyIncompatibleDailyModule",
|
||||
@@ -508,6 +510,10 @@ reports:
|
||||
}
|
||||
}
|
||||
|
||||
func retiredDailyReportKeyForTest() string {
|
||||
return strings.Join([]string{"daily", "today"}, "_")
|
||||
}
|
||||
|
||||
func TestReportModuleOverrideRejectsRetiredHourlyKeys(t *testing.T) {
|
||||
for _, key := range []string{
|
||||
strings.Join([]string{"near", "term"}, "_"),
|
||||
|
||||
@@ -252,7 +252,7 @@ func TestBuildDerivedSelectsSPCConvectiveOutlooksByValidPeriod(t *testing.T) {
|
||||
wantDiscussion []string
|
||||
}{
|
||||
{
|
||||
name: "daily today",
|
||||
name: "daily",
|
||||
resolved: resolveForTest(t, report.Daily, now, location),
|
||||
wantOutlookIDs: []string{"fri-high", "fri-storm", "fri-low", "fri-missing-rank", "fri-probabilistic"},
|
||||
wantDiscussion: []string{"day1 early", "day1 late"},
|
||||
|
||||
@@ -365,8 +365,9 @@ func TestIDForConfigKey(t *testing.T) {
|
||||
if _, err := IDForConfigKey("daily_tomorrow"); err == nil || !strings.Contains(err.Error(), `report config key "daily_tomorrow" is not a known report`) {
|
||||
t.Fatalf("IDForConfigKey(daily_tomorrow) error = %v, want unknown key", err)
|
||||
}
|
||||
if _, err := IDForConfigKey("daily_today"); err == nil || !strings.Contains(err.Error(), `report config key "daily_today" is not a known report`) {
|
||||
t.Fatalf("IDForConfigKey(daily_today) error = %v, want unknown key", err)
|
||||
retiredDailyKey := strings.Join([]string{"daily", "today"}, "_")
|
||||
if _, err := IDForConfigKey(retiredDailyKey); err == nil || !strings.Contains(err.Error(), `report config key "`+retiredDailyKey+`" is not a known report`) {
|
||||
t.Fatalf("IDForConfigKey(%s) error = %v, want unknown key", retiredDailyKey, err)
|
||||
}
|
||||
dailyID, err := IDForConfigKey("daily")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user