Remove historical inspection commands
This commit is contained in:
@@ -15,14 +15,12 @@ func dailyDefinition() Definition {
|
||||
PromptVersion: "2.0.0",
|
||||
TemplateID: "daily",
|
||||
GeneratedTextSchemaID: "daily",
|
||||
ComparisonStrategy: CompareSameValidDate,
|
||||
ArtifactGroup: "daily",
|
||||
OutputName: "daily.md",
|
||||
DistributorPathTemplates: []string{
|
||||
"daily/{valid_start_date}/{run_id}.md",
|
||||
"daily/{valid_start_date}/index.md",
|
||||
},
|
||||
CompatiblePriorIDs: []ID{Daily},
|
||||
Modules: dailyModules(),
|
||||
resolve: resolveDaily,
|
||||
runIDDisambiguator: validStartDateRunIDDisambiguator,
|
||||
|
||||
@@ -19,13 +19,6 @@ const (
|
||||
Hourly ID = "hourly"
|
||||
)
|
||||
|
||||
type ComparisonStrategy string
|
||||
|
||||
const (
|
||||
CompareSameValidDate ComparisonStrategy = "same_valid_date"
|
||||
CompareRollingWindow ComparisonStrategy = "rolling_window"
|
||||
)
|
||||
|
||||
type Batch string
|
||||
|
||||
const (
|
||||
@@ -40,11 +33,9 @@ type Definition struct {
|
||||
PromptVersion string
|
||||
TemplateID string
|
||||
GeneratedTextSchemaID string
|
||||
ComparisonStrategy ComparisonStrategy
|
||||
ArtifactGroup string
|
||||
OutputName string
|
||||
DistributorPathTemplates []string
|
||||
CompatiblePriorIDs []ID
|
||||
Modules []module.ConfigItem
|
||||
Morning bool
|
||||
Evening bool
|
||||
@@ -76,15 +67,6 @@ func (d Definition) ResolvePeriod(req ResolveRequest) (timeutil.Period, error) {
|
||||
return d.resolve(req)
|
||||
}
|
||||
|
||||
func (d Definition) CompatibleWithPrior(id ID) bool {
|
||||
for _, compatibleID := range d.CompatiblePriorIDs {
|
||||
if id == compatibleID {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (d Definition) ModuleIDs() []module.ID {
|
||||
ids := make([]module.ID, 0, len(d.Modules))
|
||||
for _, item := range d.Modules {
|
||||
|
||||
@@ -17,15 +17,13 @@ func hourlyDefinition() Definition {
|
||||
PromptVersion: "2.0.0",
|
||||
TemplateID: "hourly",
|
||||
GeneratedTextSchemaID: "hourly",
|
||||
ComparisonStrategy: CompareRollingWindow,
|
||||
ArtifactGroup: "hourly",
|
||||
OutputName: "hourly.md",
|
||||
DistributorPathTemplates: []string{
|
||||
"hourly/index.md",
|
||||
},
|
||||
CompatiblePriorIDs: []ID{Hourly},
|
||||
Modules: hourlyModules(),
|
||||
resolve: resolveHourly,
|
||||
Modules: hourlyModules(),
|
||||
resolve: resolveHourly,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,23 +87,22 @@ func TestCommandAndConfigurationNamesRejectRetiredReports(t *testing.T) {
|
||||
func TestRegistryDefinitionsPreserveRetainedContracts(t *testing.T) {
|
||||
tests := []struct {
|
||||
id ID
|
||||
comparison ComparisonStrategy
|
||||
morning bool
|
||||
evening bool
|
||||
outputName string
|
||||
paths []string
|
||||
}{
|
||||
{Daily, CompareSameValidDate, false, false, "daily.md", []string{"daily/{valid_start_date}/{run_id}.md", "daily/{valid_start_date}/index.md"}},
|
||||
{Today, CompareSameValidDate, true, false, "today.md", []string{"daily/{valid_start_date}/{run_id}.md", "daily/{valid_start_date}/index.md", "today/index.md"}},
|
||||
{Tomorrow, CompareSameValidDate, false, true, "tomorrow.md", []string{"daily/{valid_start_date}/{run_id}.md", "daily/{valid_start_date}/index.md", "tomorrow/index.md"}},
|
||||
{Hourly, CompareRollingWindow, false, false, "hourly.md", []string{"hourly/index.md"}},
|
||||
{Daily, false, false, "daily.md", []string{"daily/{valid_start_date}/{run_id}.md", "daily/{valid_start_date}/index.md"}},
|
||||
{Today, true, false, "today.md", []string{"daily/{valid_start_date}/{run_id}.md", "daily/{valid_start_date}/index.md", "today/index.md"}},
|
||||
{Tomorrow, false, true, "tomorrow.md", []string{"daily/{valid_start_date}/{run_id}.md", "daily/{valid_start_date}/index.md", "tomorrow/index.md"}},
|
||||
{Hourly, false, false, "hourly.md", []string{"hourly/index.md"}},
|
||||
}
|
||||
|
||||
registry := DefaultRegistry()
|
||||
for _, tt := range tests {
|
||||
t.Run(string(tt.id), func(t *testing.T) {
|
||||
definition := registry.MustLookup(tt.id)
|
||||
if definition.ComparisonStrategy != tt.comparison || definition.Morning != tt.morning || definition.Evening != tt.evening || definition.OutputName != tt.outputName {
|
||||
if definition.Morning != tt.morning || definition.Evening != tt.evening || definition.OutputName != tt.outputName {
|
||||
t.Fatalf("definition = %#v, want retained report contract", definition)
|
||||
}
|
||||
if strings.Join(definition.DistributorPathTemplates, "|") != strings.Join(tt.paths, "|") {
|
||||
|
||||
@@ -13,7 +13,6 @@ func todayDefinition() Definition {
|
||||
PromptVersion: "2.0.0",
|
||||
TemplateID: "today",
|
||||
GeneratedTextSchemaID: "today",
|
||||
ComparisonStrategy: CompareSameValidDate,
|
||||
ArtifactGroup: "today",
|
||||
OutputName: "today.md",
|
||||
DistributorPathTemplates: []string{
|
||||
@@ -21,10 +20,9 @@ func todayDefinition() Definition {
|
||||
"daily/{valid_start_date}/index.md",
|
||||
"today/index.md",
|
||||
},
|
||||
CompatiblePriorIDs: []ID{Today},
|
||||
Modules: todayModules(),
|
||||
Morning: true,
|
||||
resolve: resolveToday,
|
||||
Modules: todayModules(),
|
||||
Morning: true,
|
||||
resolve: resolveToday,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ func tomorrowDefinition() Definition {
|
||||
PromptVersion: "2.0.0",
|
||||
TemplateID: "tomorrow",
|
||||
GeneratedTextSchemaID: "tomorrow",
|
||||
ComparisonStrategy: CompareSameValidDate,
|
||||
ArtifactGroup: "tomorrow",
|
||||
OutputName: "tomorrow.md",
|
||||
DistributorPathTemplates: []string{
|
||||
@@ -21,10 +20,9 @@ func tomorrowDefinition() Definition {
|
||||
"daily/{valid_start_date}/index.md",
|
||||
"tomorrow/index.md",
|
||||
},
|
||||
CompatiblePriorIDs: []ID{Tomorrow},
|
||||
Modules: tomorrowModules(),
|
||||
Evening: true,
|
||||
resolve: resolveTomorrow,
|
||||
Modules: tomorrowModules(),
|
||||
Evening: true,
|
||||
resolve: resolveTomorrow,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user