testdata

package
v0.0.0-...-936a01b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testdata provides utilities for inserting dummy data for testing the insight-operator-controller .

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterName

func GetClusterName(num int) string

GetClusterName returns a string in the format "00000000-0000-0000-0000-num" where num is padded with trailing zeros until it has a length of 12 char

Types

type DataGenerator

type DataGenerator struct {
	// contains filtered or unexported fields
}

DataGenerator is a wrapper for the Storage type providing methods to insert dummy data into the database, instantiate with NewFactory(..)

func NewDataGenerator

func NewDataGenerator(dbDriver, storageSpecification string) DataGenerator

NewDataGenerator provides an instance of Factory type, allowing access to methods for creating dummy data for tests Insert the same dbDriver and storageSpecification you expect to use in your test to have meaningful and coherent tests

func (DataGenerator) Close

func (g DataGenerator) Close()

Close closes a connection to the DB created to insert the test data

func (DataGenerator) InsertTriggerType

func (g DataGenerator) InsertTriggerType(ttype, description string) error

InsertTriggerType inserts one trigger_type object with ttype type and description

func (DataGenerator) PopulateCluster

func (g DataGenerator) PopulateCluster() []error

PopulateCluster inserts clusterNo cluster objects in the database

func (DataGenerator) PopulateConfigurationProfile

func (g DataGenerator) PopulateConfigurationProfile() []error

PopulateConfigurationProfile inserts configurationProfileNo configuration_profile objects into the database

func (DataGenerator) PopulateOperatorConfiguration

func (g DataGenerator) PopulateOperatorConfiguration() []error

PopulateOperatorConfiguration inserts operatorConfigurationNo operator_configuration objects into the database

func (DataGenerator) PopulateTrigger

func (g DataGenerator) PopulateTrigger(triggerType string) []error

PopulateTrigger inserts triggerNo trigger objects into the database

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL