Documentation ¶
Overview ¶
Adopted from https://github.com/open-policy-agent/opa/blob/main/tester/reporter.go
Copyright 2017 The OPA Authors. All rights reserved. Use of this source code is governed by an Apache2 license that can be found in the LICENSE file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONReporter ¶
JSONReporter reports test results as array of JSON objects.
func (JSONReporter) Report ¶
func (r JSONReporter) Report(ch []*TestResult) error
Report prints the test report to the reporter's output.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(policyID string, client *authorizer.Client) *Manager
NewManager returns new test manager instance.
type PrettyReporter ¶
PrettyReporter reports test results in a simple human readable format.
func (PrettyReporter) Report ¶
func (r PrettyReporter) Report(ch []*TestResult) error
Report prints the test report to the reporter's output.
type Reporter ¶
type Reporter interface {
Report(ch []*TestResult) error
}
Reporter defines the interface for reporting test results.
type TestResult ¶
type TestResult struct { Package string `json:"package"` Name string `json:"name"` Fail bool `json:"fail"` Error error `json:"error"` Skip bool `json:"skip"` Duration time.Duration `json:"duration"` Output []string `json:"output"` }
func (*TestResult) Pass ¶
func (tr *TestResult) Pass() bool
Pass returns true if the test case passed.
func (*TestResult) String ¶
func (tr *TestResult) String() string
Click to show internal directories.
Click to hide internal directories.