Prepare sessions before checking readiness

This commit is contained in:
2026-11-30 15:19:22 +00:00
parent 5ca879e7e2
commit 2b4123f48f
7 changed files with 267 additions and 12 deletions

View File

@@ -48,7 +48,7 @@ func TestInspectionTargetsUseProjectedWorkAndDefinitionClosure(t *testing.T) {
if targets[2].Context.Vars["session_id"] != "narratio-session-"+cfg.Session.SessionID {
t.Fatalf("context = %+v", targets[2].Context)
}
validation, err := validationInspectionTargets(cfg, cfg.Session.SessionID)
validation, err := enabledInspectionTargets(cfg, cfg.Session.SessionID)
if err != nil || !reflect.DeepEqual(targets, validation) {
t.Fatalf("validation = %+v, error = %v", validation, err)
}
@@ -72,7 +72,7 @@ func TestInspectionTargetsSkipDisabledTrimAndAbsentScriptorium(t *testing.T) {
disabled := false
cfg.Pipeline.Trim.Enabled = &disabled
cfg.Pipeline.Scriptorium = nil
targets, err := validationInspectionTargets(cfg, cfg.Session.SessionID)
targets, err := enabledInspectionTargets(cfg, cfg.Session.SessionID)
if err != nil || len(targets) != 0 {
t.Fatalf("targets = %+v, error = %v", targets, err)
}
@@ -146,7 +146,7 @@ func TestDownstreamTargetSelectionForPolish(t *testing.T) {
}
})
}
got, err := validationDownstreamTargets(cfg, "session")
got, err := enabledDownstreamTargets(cfg, "session")
if err != nil || !got.Polish {
t.Fatalf("validation targets: %+v %v", got, err)
}
@@ -170,12 +170,12 @@ func TestDownstreamTargetSelectionForNotarius(t *testing.T) {
}
})
}
got, err := validationDownstreamTargets(cfg, "session")
got, err := enabledDownstreamTargets(cfg, "session")
if err != nil || !got.Notarius {
t.Fatalf("validation targets = %#v, %v", got, err)
}
cfg.Pipeline.Notarius.Enabled = false
got, err = validationDownstreamTargets(cfg, "session")
got, err = enabledDownstreamTargets(cfg, "session")
if err != nil || got.Notarius {
t.Fatalf("disabled targets = %#v, %v", got, err)
}