helpers

package
v0.0.0-...-32e6c6b Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const MysqlDb string = "mysql"
View Source
const PsqlDb string = "postgres"

Variables

This section is empty.

Functions

func AnalyzeDB

func AnalyzeDB(ccdb *sql.DB, ctx context.Context, testConfig Config)

func CleanupTestData

func CleanupTestData(ccdb, uaadb *sql.DB, ctx context.Context, testConfig Config)

func ConvertToString

func ConvertToString(input interface{}) string

func CreateAppFolder

func CreateAppFolder(appName string) string

func ExecuteInsertStatement

func ExecuteInsertStatement(db *sql.DB, ctx context.Context, statement string, testConfig Config) int

func ExecuteSelectStatement

func ExecuteSelectStatement(db *sql.DB, ctx context.Context, statement string) []interface{}

func ExecuteSelectStatementOneRow

func ExecuteSelectStatementOneRow(db *sql.DB, ctx context.Context, statement string) int

func ExecuteStatement

func ExecuteStatement(db *sql.DB, ctx context.Context, statement string)

func ExecuteStoredProcedure

func ExecuteStoredProcedure(db *sql.DB, ctx context.Context, statement string, testConfig Config)

func GenerateReports

func GenerateReports(reporter *JsonReporter, report types.Report)

func GetGUIDs

func GetGUIDs(user workflowhelpers.UserContext, testConfig Config, endpoint string) []string

func GetRandomFunction

func GetRandomFunction(testConfig Config) string

func GetUserGUID

func GetUserGUID(user workflowhelpers.UserContext, testConfig Config) string

func ImportStoredProcedures

func ImportStoredProcedures(ccdb *sql.DB, ctx context.Context, testConfig Config)

func LoadConfig

func LoadConfig(testConfig *Config)

func OpenDbConnections

func OpenDbConnections(testConfig Config) (ccdb, uaadb *sql.DB, ctx context.Context)

func RemoveDebugOutput

func RemoveDebugOutput(body []byte) []byte

func Shuffle

func Shuffle(items []string) []string

func TimeCFCurl

func TimeCFCurl(timeout time.Duration, curlArguments ...string)

func TimeCFCurlReturning

func TimeCFCurlReturning(timeout time.Duration, curlArguments ...string) (int, []byte)

func WaitToFail

func WaitToFail(user workflowhelpers.UserContext, testConfig Config, endpoint string)

Types

type APICreateResponse

type APICreateResponse struct {
	GUID string `json:"guid"`
}

func ParseCreateResponseBody

func ParseCreateResponseBody(body []byte) *APICreateResponse

type APIResponse

type APIResponse struct {
	Pagination struct {
		TotalPages   int `json:"total_pages"`
		TotalResults int `json:"total_results"`
	} `json:"pagination"`
	Resources []struct {
		GUID     string `json:"guid"`
		Name     string `json:"name"`
		UserName string `json:"username"`
	} `json:"resources"`
}

func ApiCall

func ApiCall(user workflowhelpers.UserContext, testConfig Config, endpoint string) *APIResponse

func ParseResponseBody

func ParseResponseBody(body []byte) *APIResponse

type Config

type Config struct {
	API                 string
	UseHttp             bool   `mapstructure:"use_http"`
	SkipSslValidation   bool   `mapstructure:"skip_ssl_validation"`
	CfDeploymentVersion string `mapstructure:"cf_deployment_version"`
	CapiVersion         string `mapstructure:"capi_version"`
	LargePageSize       int    `mapstructure:"large_page_size"`
	LargeElementsFilter int    `mapstructure:"large_elements_filter"`
	Samples             int
	BasicTimeout        time.Duration `mapstructure:"basic_timeout"`
	LongTimeout         time.Duration `mapstructure:"long_timeout"`
	Users               Users
	DatabaseType        string `mapstructure:"database_type"`
	CcdbConnection      string `mapstructure:"ccdb_connection"`
	UaadbConnection     string `mapstructure:"uaadb_connection"`
	ResultsFolder       string `mapstructure:"results_folder"`
	TestResourcePrefix  string `mapstructure:"test_resource_prefix"`
}

func NewConfig

func NewConfig() Config

func (Config) GetAddExistingUserToExistingSpace

func (config Config) GetAddExistingUserToExistingSpace() bool

func (Config) GetAdminClient

func (config Config) GetAdminClient() string

func (Config) GetAdminClientSecret

func (config Config) GetAdminClientSecret() string

func (Config) GetAdminPassword

func (config Config) GetAdminPassword() string

func (Config) GetAdminUser

func (config Config) GetAdminUser() string

func (Config) GetApiEndpoint

func (config Config) GetApiEndpoint() string

func (Config) GetConfigurableTestPassword

func (config Config) GetConfigurableTestPassword() string

func (Config) GetExistingClient

func (config Config) GetExistingClient() string

func (Config) GetExistingClientSecret

func (config Config) GetExistingClientSecret() string

func (Config) GetExistingOrganization

func (config Config) GetExistingOrganization() string

func (Config) GetExistingSpace

func (config Config) GetExistingSpace() string

func (Config) GetExistingUser

func (config Config) GetExistingUser() string

func (Config) GetExistingUserPassword

func (config Config) GetExistingUserPassword() string

func (Config) GetNamePrefix

func (config Config) GetNamePrefix() string

func (Config) GetResultsFolder

func (config Config) GetResultsFolder() string

func (Config) GetScaledTimeout

func (config Config) GetScaledTimeout(t time.Duration) time.Duration

func (Config) GetShouldKeepUser

func (config Config) GetShouldKeepUser() bool

func (Config) GetSkipSSLValidation

func (config Config) GetSkipSSLValidation() bool

func (Config) GetUseExistingOrganization

func (config Config) GetUseExistingOrganization() bool

func (Config) GetUseExistingSpace

func (config Config) GetUseExistingSpace() bool

func (Config) GetUseExistingUser

func (config Config) GetUseExistingUser() bool

type DestinationsCreateResponse

type DestinationsCreateResponse struct {
	Destinations []struct {
		GUID string `json:"guid"`
	} `json:"destinations"`
}

func ParseDestinationsCreateResponseBody

func ParseDestinationsCreateResponseBody(body []byte) *DestinationsCreateResponse

type JsonReporter

type JsonReporter struct {
	Measurements map[string]map[string]Measurement `json:"measurements"`

	CfDeploymentVersion string `json:"cfDeploymentVersion"`
	Timestamp           int64  `json:"timestamp"`
	CapiVersion         string `json:"capiVersion"`
	CCDBVersion         string `json:"ccdbVersion"`
	// contains filtered or unexported fields
}

func ConfigureJsonReporter

func ConfigureJsonReporter(testConfig *Config, testSuiteName string, testHeadlineName string, test_version string) *JsonReporter

func NewJsonReporter

func NewJsonReporter(outputFile string, testHeadlineName string, cfDeploymentVersion string, CapiVersion string, timestamp int64, testSuiteName string, ccdbVersion string) *JsonReporter

type Measurement

type Measurement struct {
	Name          string      `json:"Name"`
	Info          interface{} `json:"Info"`
	Order         int         `json:"Order"`
	Results       []float64   `json:"Results"`
	Smallest      float64     `json:"Smallest"`
	Largest       float64     `json:"Largest"`
	Average       float64     `json:"Average"`
	StdDeviation  float64     `json:"StdDeviation"`
	SmallestLabel string      `json:"SmallestLabel"`
	LargestLabel  string      `json:"LargestLabel"`
	AverageLabel  string      `json:"AverageLabel"`
	Units         string      `json:"Units"`
}

type User

type User struct {
	Username     string
	Password     string
	Client       string
	ClientSecret string
}

type Users

type Users struct {
	Admin    User
	Existing User
}

Jump to

Keyboard shortcuts

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