Remove superseded history attribution paths
This commit is contained in:
@@ -50,21 +50,14 @@ func TestPostDecodeOverrideContextOrdersDecodeCLIAndResolutionEvidence(t *testin
|
||||
t.Fatalf("applyDecodedOverrides() issues = %#v", issues)
|
||||
}
|
||||
prepared := preparePostDecodeOverrideContext(input, decoded, assigned)
|
||||
if prepared.historyBuilder == nil || prepared.historyBuilder != prepared.metadata.historyBuilder || !prepared.historyBuilder.prefixReady {
|
||||
if prepared.metadata.historyBuilder == nil || !prepared.metadata.historyBuilder.prefixReady {
|
||||
t.Fatal("post-decode handoff did not retain the completed history prefix")
|
||||
}
|
||||
if prepared.resolution.metadata.historyBuilder != nil || prepared.resolution.metadata.historyModel != nil {
|
||||
t.Fatal("resolution entry view borrowed mutable or historical state")
|
||||
}
|
||||
if prepared.structuralInput == structural || prepared.preCLI == decoded.final ||
|
||||
prepared.decoded.final == assigned.final || prepared.referenceInput == assigned.final {
|
||||
t.Fatal("structural, pre-CLI, post-CLI, and located snapshots are not detached")
|
||||
}
|
||||
if raw, ok := documentAtPath(prepared.structuralInput, Keys("version")); !ok || raw.Kind != document.Number || raw.Text != "1" {
|
||||
t.Fatalf("structural version = %#v", raw)
|
||||
}
|
||||
if typed, ok := documentAtPath(prepared.preCLI, Keys("version")); !ok || typed.Kind != document.String || typed.Text != "1" {
|
||||
t.Fatalf("pre-CLI typed version = %#v", typed)
|
||||
if prepared.decoded.final == assigned.final || prepared.referenceInput == assigned.final {
|
||||
t.Fatal("post-CLI configuration and located resolution views are not detached")
|
||||
}
|
||||
if prepared.metadata.fields["/count"].Origin.Layer != LayerCLI || !prepared.metadata.fields["/count"].Explicit {
|
||||
t.Fatalf("equal-value CLI metadata = %#v", prepared.metadata.fields["/count"])
|
||||
@@ -75,9 +68,6 @@ func TestPostDecodeOverrideContextOrdersDecodeCLIAndResolutionEvidence(t *testin
|
||||
if _, explicit := prepared.decoded.presence["/items/0/enabled"]; explicit {
|
||||
t.Fatal("replaced list retained discarded-child presence")
|
||||
}
|
||||
if len(prepared.applications) != 1 || len(prepared.postDecodeApps) != len(batch.overrides) || len(prepared.historyApplications()) != 1+len(batch.overrides) {
|
||||
t.Fatalf("history applications = structural:%d CLI:%d all:%d", len(prepared.applications), len(prepared.postDecodeApps), len(prepared.historyApplications()))
|
||||
}
|
||||
if prepared.resolution.contexts["source-1"].BaseDir != "/config" {
|
||||
t.Fatalf("resolution source contexts = %#v", prepared.resolution.contexts)
|
||||
}
|
||||
@@ -101,8 +91,8 @@ func TestPostDecodeOverrideContextOrdersDecodeCLIAndResolutionEvidence(t *testin
|
||||
if len(resolveDiagnostics) != 0 {
|
||||
t.Fatalf("resolveLoadInput() diagnostics = %#v", resolveDiagnostics)
|
||||
}
|
||||
if resolvedContext.historyBuilder == nil || resolvedContext.historyBuilder != resolvedContext.metadata.historyBuilder ||
|
||||
resolvedContext.historyBuilder.model.resolutionPayload == nil || len(resolvedContext.historyBuilder.model.resolutionPayload.snapshots) != 1 {
|
||||
if resolvedContext.metadata.historyBuilder == nil || resolvedContext.metadata.historyBuilder.model.resolutionPayload == nil ||
|
||||
len(resolvedContext.metadata.historyBuilder.model.resolutionPayload.snapshots) != 1 {
|
||||
t.Fatal("resolution evidence was not appended once to the handed-off model")
|
||||
}
|
||||
if location, ok := metadataFieldLocation(resolvedContext.metadata, Keys("count"), Origin{Layer: LayerResolution}); !ok || location.SourceID != countSource {
|
||||
@@ -115,7 +105,7 @@ func TestPostDecodeOverrideContextOrdersDecodeCLIAndResolutionEvidence(t *testin
|
||||
t.Fatalf("post-resolution reference location = %#v, %v", value, ok)
|
||||
}
|
||||
|
||||
finalizeMetadataPaths(&prepared.metadata, assigned.final, prepared.historyApplications(), decoded.baseline, prepared.structuralInput, prepared.preCLI, assigned.final)
|
||||
freezeMetadataHistory(&prepared.metadata, assigned.final)
|
||||
inspection := Inspection{
|
||||
metadata: prepared.metadata, history: prepared.metadata.historyModel, final: assigned.final,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user