gitea: the package seats' bed passes the publish kit unchanged, no answer translated
Builds: design 47 H2 H-A-729, H-A-738 (1), H-A-593 (2)
This commit is contained in:
@@ -129,17 +129,6 @@ func (f *memFingerprints) Put(k string, v Kept) error {
|
||||
}
|
||||
func (f *memFingerprints) Delete(k string) error { delete(f.m, k); return nil }
|
||||
|
||||
// asKitKnows reports an other-bytes answer as the refusal the publish conformance kit's RunReserved row (a version held under
|
||||
// another digest, published whole) still looks for; that row reads H-A-589's old refusal, which H-A-729 and H-A-738 replace.
|
||||
func asKitKnows(a Answer, err error) (Answer, error, string) {
|
||||
if a.OtherBytes == nil {
|
||||
return a, err, ""
|
||||
}
|
||||
reason := "not stored: is published with " + a.OtherBytes.Digest
|
||||
a.Ended = true
|
||||
return a, errors.New("publish: " + reason), reason
|
||||
}
|
||||
|
||||
func newBed(numbered bool) *bed {
|
||||
b := &bed{forge: &forge{files: map[string]map[string][]byte{}}, findings: map[string]bool{}}
|
||||
b.h = &Holder{Objects: memObjects{}, Transfers: memTransfers{}, Fingerprints: &memFingerprints{m: map[string]Kept{}}, Builder: builder{ok: numbered},
|
||||
@@ -257,14 +246,13 @@ func TestTheForgeHoldsBothPackageSeats(t *testing.T) {
|
||||
Hold: func() { b.forge.holdDigest(seat, "mesh-sdk", "0.1.19", digest([]byte("first"))) },
|
||||
PublishWhole: func() publishconformance.Outcome {
|
||||
a, err := b.h.Publish(seat, goBuild, pub("mesh-sdk", "0.1.19", whole))
|
||||
a, err, refused := asKitKnows(a, err)
|
||||
if refused != "" {
|
||||
return publishconformance.Outcome{Event: "refused", Reason: refused}
|
||||
}
|
||||
if err == nil && !a.Ended {
|
||||
if err == nil && !a.Ended && a.OtherBytes == nil {
|
||||
_, err = b.h.PublishPart(seat, goBuild, "t-mesh-sdk", digest(whole), 0, true, whole)
|
||||
}
|
||||
o := publishconformance.Outcome{Err: err}
|
||||
if a.OtherBytes != nil {
|
||||
o.Other = &publishconformance.OtherBytes{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint}
|
||||
}
|
||||
if len(b.said) > 0 {
|
||||
o.Event, o.Reason = b.said[len(b.said)-1].event, b.said[len(b.said)-1].o.Reason
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user