Documentation
¶
Overview ¶
Package backendtest is the officer-backend conformance suite (officer-backend/v1, docs/design/officers-first-class.md): the lease, queue, tier and refusal rules every officers.Backend must keep, as named checks over a small World. It runs against HQ's client over the hqtest fake and against the built-in backend over Postgres, and each harness carries a fault-injection knob that lets a second claim through a live lease — run with it on, the double-claim check must fail, so the suite is shown able to go red against each backend, not only green.
Index ¶
Constants ¶
const ( OfficerA = "triage:conformance-a" OfficerB = "triage:conformance-b" )
The two officers every World declares, each with its own items. Both are owned by user 1.
const CheckDoubleClaim = "a live lease refuses another instance's claim"
CheckDoubleClaim is the check a double-claim fault must fail.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type World ¶
type World interface {
// Backend is the backend of OfficerA or OfficerB.
Backend(officer string) officers.Backend
// AddItem adds an open, unblocked item and returns its id. tier is
// routine or judgement; priority "" is normal.
AddItem(officer, kind, subject, tier, priority string) officers.ItemID
// SetBlocked marks item id blocked (by some unfinished task).
SetBlocked(id officers.ItemID)
// SetEnabled turns officer's switch on or off.
SetEnabled(officer string, on bool)
// SetCharter sets officer's charter (its type's).
SetCharter(officer, charter string)
// Advance moves the backend's clock forward by d.
Advance(d time.Duration)
}
World is one backend implementation under test, freshly seeded with the two officers, no items, both enabled.