Documentation ¶
Index ¶
- func FactByRecord(ctx context.Context, tx *sqlx.Tx, dt *db.DateTime, record reporting.Record) (*db.Fact, error)
- func RequestRecorder(t *testing.T, path string) (*http.Client, func(), error)
- type Suite
- func (ts *Suite) EnsureNS(name string, labels map[string]string)
- func (ts *Suite) EnsureResources(resources ...client.Object)
- func (ts *Suite) RegisterScheme(addToScheme func(s *runtime.Scheme) error)
- func (ts *Suite) SetupEnv(crdPaths []string)
- func (ts *Suite) SetupSuite()
- func (ts *Suite) SetupTest()
- func (ts *Suite) TearDownSuite()
- func (ts *Suite) TearDownTest()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FactByRecord ¶
Types ¶
type Suite ¶
type Suite struct { suite.Suite NS string Client client.Client Config *rest.Config Env *envtest.Environment Logger logr.Logger Context context.Context Scheme *runtime.Scheme DatabaseURL string // contains filtered or unexported fields }
func (*Suite) EnsureNS ¶
EnsureNS creates a new Namespace, validating the name in accordance with k8s validation rules.
func (*Suite) EnsureResources ¶
EnsureResources ensures that the given resources are existing in the suite. Each error will fail the test.
func (*Suite) RegisterScheme ¶
RegisterScheme passes the current scheme to the given SchemeBuilder func.
func (*Suite) SetupSuite ¶
func (ts *Suite) SetupSuite()
SetupSuite is used for setting up the testsuite before all tests are run. If you need to override it, make sure to call `SetupEnv()` first.
func (*Suite) SetupTest ¶
func (ts *Suite) SetupTest()
SetupTest ensures a separate temporary DB for each test
func (*Suite) TearDownSuite ¶
func (ts *Suite) TearDownSuite()
TearDownSuite implements suite.TearDownAllSuite. It is used to shut down the local envtest environment.
func (*Suite) TearDownTest ¶
func (ts *Suite) TearDownTest()
TearDownTest cleans up temporary DB after each test
Click to show internal directories.
Click to hide internal directories.