Files
mesh-delivery/modules/mesh-delivery-assigner/internal/buckets/buckets_test.go
T
jschoubben 1cf2ea46ff A11: a composition step's progress names the asker its step run carries
With no callers list on the seat mesh-wants, the asker a step's progress names is
the one the runner writes on the StepRun it asks (C-W2), mesh-pipeline-runner.

Builds: design 47 H §752 (consequence), G §496; H-A-41, H-A-88

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 04:57:44 +01:00

42 lines
1.8 KiB
Go

package buckets
import (
"testing"
plc "mesh-delivery-assigner/internal/assignment"
)
// The names are the ones the earlier shared form held (mesh-sdk's go/delivery), and the ones the manifest's reads and
// states say: a bucket is `<module>_<state>`.
func TestBucketsAreTheEarlierNames(t *testing.T) {
for name, c := range map[string][2]string{
"Have": {Have, "node-engine_have"}, "ComposedRead": {ComposedRead, "mesh-host.composed"},
"Modules": {Modules, "mesh-delivery-indexer_modules"}, "Manifests": {Manifests, "mesh-delivery-indexer_manifests"},
"Answers": {Answers, "mesh-delivery-teller_answers"},
"Grants": {Grants, "mesh-grants_grants"},
"TellerModule": {TellerModule, "mesh-delivery-teller"},
} {
if c[0] != c[1] {
t.Errorf("%s = %q, want %q", name, c[0], c[1])
}
}
}
// The assigner's own buckets are named from the module it runs as, its credential's, never from a constant of its name
// (design 47 G A-296, §428): a bucket is `<module>_<state>` of whatever module SetModule was told.
func TestTheAssignersOwnBucketsTakeTheModuleItRunsAs(t *testing.T) {
defer plc.SetModule(plc.Module())
plc.SetModule("some-assigner")
for name, c := range map[string][2]string{
"Wants": {Wants(), "some-assigner_wants"}, "Differences": {Differences(), "some-assigner_differences"},
"Asks": {Asks(), "some-assigner_asks"}, "Puts": {Puts(), "some-assigner_puts"}, "Policies": {Policies(), "some-assigner_policies"},
"Waits": {Waits(), "some-assigner_waits"}, "Inputs": {Inputs(), "some-assigner_inputs"},
"CompositionRuns": {CompositionRuns(), "some-assigner_composition-runs"},
"Assignments": {plc.AssignmentsBucket(), "some-assigner_assignments"}, "SeatHolders": {plc.SeatHoldersBucket(), "some-assigner_seat-holders"},
} {
if c[0] != c[1] {
t.Errorf("%s = %q, want %q", name, c[0], c[1])
}
}
}