Documentation
¶
Overview ¶
Package compliance provides the tools to validate the compliance of driver implementations and BQL behavior testing. The compliance package is built around stories. A story is a collection of graphs and a sequence of assertions against the provided data. An assertion is defined by a tuple containing a BQL, the execution status, and the expeted result table.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assertion ¶
type Assertion struct { // Requires of the assertion. Requires string // Statement contains the BQL query to assert. Statement string // WillFail indicates if the query should fail with and error. WillFail bool // MustReturn contains the table containing the expected results provided // by the BQL statemnet execution. MustReturn []map[string]string // contains filtered or unexported fields }
Assertion contains a BQL, the expecte status of the BQL query execution, and the returned results table.
type AssertionBattery ¶ added in v0.1.1
type AssertionBattery struct {
Entries []*AssertionBatteryEntry
}
AssertionBattery contains the result of running a collection of stories.
type AssertionBatteryEntry ¶ added in v0.1.1
type AssertionBatteryEntry struct { Story *Story Outcome map[string]*AssertionOutcome Err error }
AssertionBatteryEntry contains teh result of running a story.
type AssertionOutcome ¶
AssertionOutcome contains the result of running one assertion of a given story.
type Graph ¶
type Graph struct { // ID of the binding name to use for the graph. ID string // Facts contains the parseable tribles which define the graph. Facts []string }
Graph contains the graph binding name and the list of parseable triples that define it.
type Story ¶
type Story struct { // Name of the story. Name string // Sources contains the list of graphs used in the story. Sources []*Graph // Assertions that need to be validated against the provided sources. Assertions []*Assertion }
Story contains the available graphs and the collection of assertions to validate.
func (*Story) Run ¶
func (s *Story) Run(ctx context.Context, st storage.Store, b literal.Builder, chanSize int) (map[string]*AssertionOutcome, error)
Run evaluates a story. Returns if the story is true or not. It will also return an error if something wrong happen along the way. It is worth mentioning that Run does not clear any data avaiable in the provided storage.