Verify imported products through publication and local execution
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user