Documentation
¶
Overview ¶
Package plan orders the cases of a run (FR-ORDER): resource groups follow the dependency graph of their bindings, cases within a group follow their rank (create, read, list, update, 4xx, authentication, delete; the operations of Options.LastInTag after all but the deletes), DELETE cases of groups that others depend on (or of all groups with DeleteLast) run after all groups, in reverse order. All regular cases of the run come first, then the 4xx/5xx examples, conflict and authentication cases, and the generated not-found cases at the very end.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Tags is Config.Tags: the order of the groups where bindings allow it.
Tags []string
// DeleteLast runs the DELETE cases of every group after all other
// cases, in reverse group order, instead of only for groups that others
// depend on.
DeleteLast bool
// LastInTag are operations (operationId or "METHOD /path") whose cases
// run after all other cases of their group, whatever their method, in
// the order listed; only the DELETE cases of the group follow them.
LastInTag []string
}
Options influence the order.
type Plan ¶
type Plan struct {
Segments []Segment
// Deps lists the producer cases each case needs a value from.
Deps map[*cases.Case][]*cases.Case
// Precondition marks cases that are only run because a selected case
// needs their bindings (FR-GO-02).
Precondition map[*cases.Case]bool
Groups []string // group order
}
Plan is the execution order of a run.
func Build ¶
func Build(all []*cases.Case, selected func(*cases.Case) bool, set *bind.Set, opt Options) (*Plan, error)
Build plans the cases. all must contain every case of the spec in the order of cases.Build; selected tells which of them the user asked for. Unselected cases are only kept if a selected case depends on them.