helpers

package
v0.0.0-...-26de28a Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupTestData

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

func ExecuteInsertStatement

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

func ExecutePreparedInsertStatement

func ExecutePreparedInsertStatement(db *sql.DB, ctx context.Context, statement string, args ...interface{}) 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 GetGUIDs

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

func GetTotalResults

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

func GetUserGUID

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

func GetXRuntimeHeader

func GetXRuntimeHeader(response []byte) float64

func ImportStoredProcedures

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

func OpenDbConnections

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

func SelectRandom

func SelectRandom(items []string, count int) []string

func Shuffle

func Shuffle(items []string) []string

func TimeCFCurl

func TimeCFCurl(b ginkgo.Benchmarker, timeout time.Duration, curlArguments ...string)

func TimeCFCurlReturning

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

func WaitToFail

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

Types

type APIResponse

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

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
	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) 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 JsonReporter

type JsonReporter struct {
	// only capitalised elements are exported and marshalled to json
	Measurements map[string]map[string]*types.SpecMeasurement `json:"measurements"`

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

func ConfigureJsonReporter

func ConfigureJsonReporter(t *testing.T, testConfig *Config, testSuiteName string) *JsonReporter

func NewJsonReporter

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

func (*JsonReporter) AfterSuiteDidRun

func (reporter *JsonReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)

func (*JsonReporter) BeforeSuiteDidRun

func (reporter *JsonReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary)

func (*JsonReporter) SpecDidComplete

func (reporter *JsonReporter) SpecDidComplete(specSummary *types.SpecSummary)

func (*JsonReporter) SpecSuiteDidEnd

func (reporter *JsonReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)

func (*JsonReporter) SpecSuiteWillBegin

func (reporter *JsonReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)

func (*JsonReporter) SpecWillRun

func (reporter *JsonReporter) SpecWillRun(specSummary *types.SpecSummary)

type Reporter

type Reporter interface {
	SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
	BeforeSuiteDidRun(setupSummary *types.SetupSummary)
	SpecWillRun(specSummary *types.SpecSummary)
	SpecDidComplete(specSummary *types.SpecSummary)
	AfterSuiteDidRun(setupSummary *types.SetupSummary)
	SpecSuiteDidEnd(summary *types.SuiteSummary)
}

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