composer.Manifest gains Fingerprint (wire {"digest","fingerprint"}) and Fill's get takes the Manifest. The checker fills it from a
pull's fingerprint, else from the trunk revision's entry of the module (repoModules keeps each entry's fingerprint).
Builds: design 47 G A-310
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
24 lines
1.3 KiB
Go
24 lines
1.3 KiB
Go
package check
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
|
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/composer"
|
|
)
|
|
|
|
// Design 47 G A-310: a manifest the judge's request names by its digest names the fingerprint whose catalog graph entry holds
|
|
// it: a pull's own fingerprint for a module the pull changes, the trunk revision's entry for the rest.
|
|
func TestTheJudgeRequestNamesEachManifestsFingerprint(t *testing.T) {
|
|
pull := Pull{Fps: map[string]meshcatalog.CandidatesByGroupValuePullsItemFpsValue{"changed": {Manifest: "d2", Fp2: "src2:pull"}}}
|
|
req, _ := judgeRequest(map[string]string{"changed": "d1", "same": "d3"}, map[string]string{"changed": "src2:trunk", "same": "src2:same"}, []Pull{pull})
|
|
got, trunk := req.Cases[0].Manifests, req.Cases[1].Manifests
|
|
if !reflect.DeepEqual(got["changed"], composer.Manifest{Digest: "d2", Fingerprint: "src2:pull"}) || !reflect.DeepEqual(got["same"], composer.Manifest{Digest: "d3", Fingerprint: "src2:same"}) {
|
|
t.Errorf("the change's manifests = %+v", got)
|
|
}
|
|
if !reflect.DeepEqual(trunk["changed"], composer.Manifest{Digest: "d1", Fingerprint: "src2:trunk"}) {
|
|
t.Errorf("the trunk's manifest = %+v, want the trunk entry's fingerprint", trunk["changed"])
|
|
}
|
|
}
|