Verify imported products through publication and local execution

This commit is contained in:
2026-12-02 16:33:08 +00:00
parent e7fada4372
commit 56483f9064
7 changed files with 334 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"os"
"path/filepath"
"reflect"
"testing"
"time"
@@ -73,6 +74,8 @@ func TestInventoryImportReplacesProductAndInvalidatesDependents(t *testing.T) {
for _, name := range []string{"prepare", "trim", "render", "extract", "analyze"} {
local.MarkStageSucceeded(name, time.Now().UTC(), nil)
}
setAppAnalyzeEvidence(local, "unrelated", "artifacts/unrelated.md", []byte("existing checkpoint"))
checkpoint := manifest.CloneAnalyzeArtifactCollection(local.Stages["analyze"].AnalyzeArtifacts)
if err := (&manifest.LocalStore{}).Save(ctx, paths.ManifestPath, local); err != nil {
t.Fatal(err)
}
@@ -105,6 +108,9 @@ func TestInventoryImportReplacesProductAndInvalidatesDependents(t *testing.T) {
t.Fatalf("%s status = %q", name, loaded.Stages[name].Status)
}
}
if !reflect.DeepEqual(loaded.Stages["analyze"].AnalyzeArtifacts, checkpoint) {
t.Fatalf("unrelated analysis checkpoint changed: %#v", loaded.Stages["analyze"].AnalyzeArtifacts)
}
if !artifacts.SuppliedTranscriptCoverage(paths, loaded.SuppliedProducts)["trim"] {
t.Fatal("replacement is not available")
}