Schedule ordinary import contributions by dependency

This commit is contained in:
2026-10-19 19:29:35 +00:00
parent 91ab37a39d
commit 5ed0f55970
7 changed files with 159 additions and 13 deletions

View File

@@ -13,10 +13,14 @@ import (
configkit "gitea.maximumdirect.net/eric/ConfigKit"
)
func TestFacadeSourceVersionEvidenceFollowsAuthoredSequenceRanges(t *testing.T) {
func TestFacadeSourceVersionEvidenceFollowsAssembledSequenceRanges(t *testing.T) {
t.Parallel()
for _, grouped := range []bool{false, true} {
for _, sensitivePath := range []string{"", "/records/1/version", "/records/1"} {
index := 0
if grouped {
index = 1
}
for _, sensitivePath := range []string{"", fmt.Sprintf("/records/%d/version", index), fmt.Sprintf("/records/%d", index)} {
t.Run(fmt.Sprintf("grouped=%t/secret=%s", grouped, sensitivePath), func(t *testing.T) {
definition := configkit.Definition[map[string]any]{
SequenceCompositions: []configkit.SequenceComposition{{Path: configkit.Keys("records"), IdentityField: "id"}},
@@ -46,6 +50,16 @@ func TestFacadeSourceVersionEvidenceFollowsAuthoredSequenceRanges(t *testing.T)
if err != nil {
t.Fatal(err)
}
if !grouped {
records, ok := result.Config["records"].([]any)
if !ok || len(records) != 2 {
t.Fatalf("scheduled records = %#v", result.Config["records"])
}
firstRecord, ok := records[0].(map[string]any)
if !ok || firstRecord["id"] != "child" {
t.Fatalf("scheduled records = %#v", result.Config["records"])
}
}
sources := result.Sources()
check := sources[len(sources)-1].VersionCheck
if check == nil || check.Path.String() != "/records/0/version" || check.Location == nil || check.Location.SourceID != sources[len(sources)-1].ID {