Documentation ¶
Overview ¶
Package tester contains utilities for executing Rego tests.
Index ¶
Constants ¶
View Source
const TestPrefix = "test_"
TestPrefix declares the prefix for all rules.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrettyReporter ¶
PrettyReporter reports test results in a simple human readable format.
func (PrettyReporter) Report ¶
func (r PrettyReporter) Report(ch chan *Result) error
Report prints the test report to the reporter's output.
type Result ¶
type Result struct { Location *ast.Location `json:"location"` Package string `json:"package"` Name string `json:"name"` Fail *interface{} `json:"fail,omitempty"` Error error `json:"error,omitempty"` Duration time.Duration `json:"duration"` }
Result represents a single test case result.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner implements simple test discovery and execution.
func (*Runner) Run ¶ added in v0.5.9
func (r *Runner) Run(ctx context.Context, modules map[string]*ast.Module) (ch chan *Result, err error)
Run executes all tests contained in supplied modules.
func (*Runner) SetCompiler ¶
SetCompiler sets the compiler used by the runner.
Click to show internal directories.
Click to hide internal directories.