An edge is recorded by path, like the artifact it points at #114
@@ -17,8 +17,8 @@ import (
|
|||||||
|
|
||||||
var aDigest = "sha256:" + strings.Repeat("e", 64)
|
var aDigest = "sha256:" + strings.Repeat("e", 64)
|
||||||
|
|
||||||
// **A build is recorded by digest and path**, whatever address the builder pushed to — and only
|
// **A build is recorded by digest and path**, whatever address the builder pushed to — what it
|
||||||
// what the build made is rewritten: an image the module runs from elsewhere is left where it says.
|
// made and what it stood on both; an image the module runs from elsewhere is left where it says.
|
||||||
func TestABuildIsRecordedWithoutTheStoresAddress(t *testing.T) {
|
func TestABuildIsRecordedWithoutTheStoresAddress(t *testing.T) {
|
||||||
manifest, _ := json.Marshal(map[string]any{
|
manifest, _ := json.Marshal(map[string]any{
|
||||||
"module": "gitea", "version": "1",
|
"module": "gitea", "version": "1",
|
||||||
@@ -65,8 +65,11 @@ func TestABuildIsRecordedWithoutTheStoresAddress(t *testing.T) {
|
|||||||
if strings.Contains(string(kept.Manifest), "anchor.internal:5100") {
|
if strings.Contains(string(kept.Manifest), "anchor.internal:5100") {
|
||||||
t.Errorf("the recorded manifest still carries the store's address:\n%s", kept.Manifest)
|
t.Errorf("the recorded manifest still carries the store's address:\n%s", kept.Manifest)
|
||||||
}
|
}
|
||||||
if kept.Against[0] != "anchor.internal:5100/mesh-tools/runtime@"+aDigest {
|
// What the build stood on is an edge to another module's artifact, and it is recorded the way
|
||||||
t.Errorf("what the build stood on was rewritten: %v", kept.Against)
|
// that artifact is: by path in the store, so the edge still names the same thing when the
|
||||||
|
// store answers at another address.
|
||||||
|
if kept.Against[0] != catalogue.ArtifactStoreScheme+"mesh-tools/runtime@"+aDigest {
|
||||||
|
t.Errorf("what the build stood on was recorded by address: %v", kept.Against)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user