Documentation ¶
Index ¶
- Variables
- func AssertClusters(t *testing.T, expected []repository.Cluster, actual repository.Cluster, ...)
- func AssertContainsClusters(t *testing.T, expected, contains []repository.Cluster, ...)
- func AssertEqualCluster(t *testing.T, expected, actual repository.Cluster, expectSensitiveInfo bool)
- func AssertEqualClusterData(t *testing.T, expected repository.Cluster, actual app.ClusterData)
- func AssertEqualClusterDetails(t *testing.T, expected, actual repository.Cluster, expectSensitiveInfo bool)
- func AssertEqualClusters(t *testing.T, expected, actual []repository.Cluster, expectSensitiveInfo bool)
- func AssertEqualClustersData(t *testing.T, expected []repository.Cluster, actual []*app.ClusterData)
- func AssertEqualFullClusterData(t *testing.T, expected repository.Cluster, actual app.FullClusterData)
- func AssertEqualFullClustersData(t *testing.T, expected []repository.Cluster, actual []*app.FullClusterData)
- func AssertEqualIdentityClusters(t *testing.T, expected, actual repository.IdentityCluster)
- func AssertError(t require.TestingT, actualError error, expectedType interface{}, ...)
- func CreateCluster(t *testing.T, db *gorm.DB, options ...createClusterOption) repository.Cluster
- func CreateIdentityCluster(t *testing.T, db *gorm.DB, options ...CreateIdentityClusterOption) repository.IdentityCluster
- func FilterClusterByURL(url string, clusters []repository.Cluster) (repository.Cluster, error)
- func NewCluster(options ...createClusterOption) repository.Cluster
- func Normalize(source repository.Cluster, changes ...NormalizeCluster) repository.Cluster
- func Run(b *testing.B, suite BenchingSuite)
- func WithType(t string) func(*repository.Cluster)
- type AfterBenchmark
- type BeforeBenchmark
- type BenchingSuite
- type CreateIdentityClusterOption
- type NormalizeCluster
- type SetupAllSuite
- type SetupBenchmarkSuite
- type Suite
- type TearDownAllSuite
- type TearDownBenchmarkSuite
Constants ¶
This section is empty.
Variables ¶
var AddTrailingSlashes = func(source repository.Cluster) repository.Cluster { source.URL = httpsupport.AddTrailingSlashToURL(source.URL) source.ConsoleURL = httpsupport.AddTrailingSlashToURL(source.ConsoleURL) source.LoggingURL = httpsupport.AddTrailingSlashToURL(source.LoggingURL) source.MetricsURL = httpsupport.AddTrailingSlashToURL(source.MetricsURL) return source }
AddTrailingSlashes a normalize function which converts all URL by adding a trailing slash if needed
Functions ¶
func AssertClusters ¶
func AssertClusters(t *testing.T, expected []repository.Cluster, actual repository.Cluster, expectSensitiveInfo bool)
AssertClusters verifies that the `actual` cluster belongs to the `expected`, and compares all fields including sensitive details if `expectSensitiveInfo` is `true`
func AssertContainsClusters ¶
func AssertContainsClusters(t *testing.T, expected, contains []repository.Cluster, expectSensitiveInfo bool)
AssertContainsClusters verifies that all the list of `expected` clusters contains the given list of clusters
func AssertEqualCluster ¶
func AssertEqualCluster(t *testing.T, expected, actual repository.Cluster, expectSensitiveInfo bool)
AssertEqualCluster verifies that the `actual` and `expected` clusters are have the same values including sensitive details if `expectSensitiveInfo` is `true`
func AssertEqualClusterData ¶
func AssertEqualClusterData(t *testing.T, expected repository.Cluster, actual app.ClusterData)
AssertEqualClusterData verifies that data for actual cluster match the expected one
func AssertEqualClusterDetails ¶
func AssertEqualClusterDetails(t *testing.T, expected, actual repository.Cluster, expectSensitiveInfo bool)
AssertEqualClusterDetails verifies that the `actual` and `expected` clusters are have the same values including sensitive details if `expectSensitiveInfo` is `true`
func AssertEqualClusters ¶
func AssertEqualClusters(t *testing.T, expected, actual []repository.Cluster, expectSensitiveInfo bool)
AssertEqualClusters verifies that all the `actual` and `expected` clusters are have the same values including sensitive details if `expectSensitiveInfo` is `true`
func AssertEqualClustersData ¶
func AssertEqualClustersData(t *testing.T, expected []repository.Cluster, actual []*app.ClusterData)
AssertEqualClustersData verifies that data for all actual clusters match the expected ones
func AssertEqualFullClusterData ¶
func AssertEqualFullClusterData(t *testing.T, expected repository.Cluster, actual app.FullClusterData)
AssertEqualFullClusterData verifies that data for actual cluster match the expected one
func AssertEqualFullClustersData ¶
func AssertEqualFullClustersData(t *testing.T, expected []repository.Cluster, actual []*app.FullClusterData)
AssertEqualFullClustersData verifies that data for all actual clusters match the expected ones
func AssertEqualIdentityClusters ¶
func AssertEqualIdentityClusters(t *testing.T, expected, actual repository.IdentityCluster)
AssertEqualIdentityClusters verifies that the identity/cluster links are equal
func AssertError ¶
func AssertError(t require.TestingT, actualError error, expectedType interface{}, expectedMsgAndArgs ...interface{})
AssertError verifies that the given error has the expected type and message
func CreateCluster ¶
CreateCluster returns a new cluster after saves it in the DB
func CreateIdentityCluster ¶
func CreateIdentityCluster(t *testing.T, db *gorm.DB, options ...CreateIdentityClusterOption) repository.IdentityCluster
CreateIdentityCluster returns a new IdentityCluster after saving it in the DB. if no identity or cluster was provided in the options, a random UUID is used for the identity ID and a new cluster is created on the fly
func FilterClusterByURL ¶
func FilterClusterByURL(url string, clusters []repository.Cluster) (repository.Cluster, error)
FilterClusterByURL returns the cluster that has the given URL or an error if none was found
func NewCluster ¶
func NewCluster(options ...createClusterOption) repository.Cluster
NewCluster returns a new cluster with random values for all fields
func Normalize ¶
func Normalize(source repository.Cluster, changes ...NormalizeCluster) repository.Cluster
Normalize returns a new cluster based on the source option, with normalization functions applied
func Run ¶
func Run(b *testing.B, suite BenchingSuite)
Run takes a testing suite and runs all of the benchmarks attached to it.
func WithType ¶
func WithType(t string) func(*repository.Cluster)
WithType an option to specify the type of the cluster to create
Types ¶
type AfterBenchmark ¶
type AfterBenchmark interface {
AfterBenchmark(suiteName, testName string)
}
AfterBenchmark has a function to be executed right after the benchmark finishes and receives the suite and benchmark names as input
type BeforeBenchmark ¶
type BeforeBenchmark interface {
BeforeBenchmark(suiteName, testName string)
}
BeforeBenchmark has a function to be executed right before the benchmark starts and receives the suite and benchmark names as input
type BenchingSuite ¶
BenchingSuite can store and return the current *testing.B context generated by 'go test -bench=.'.
type CreateIdentityClusterOption ¶
type CreateIdentityClusterOption func(*repository.IdentityCluster)
CreateIdentityClusterOption an option to configure the identity/cluster link to create
func WithCluster ¶
func WithCluster(c repository.Cluster) CreateIdentityClusterOption
WithCluster an option to specify the cluster to use when linking to an identity
func WithIdentityID ¶
func WithIdentityID(identityID uuid.UUID) CreateIdentityClusterOption
WithIdentityID an option to specify the identity to use when linking to a cluster
type NormalizeCluster ¶
type NormalizeCluster func(repository.Cluster) repository.Cluster
NormalizeCluster a function to normalize one or more field in a given cluster
type SetupAllSuite ¶
type SetupAllSuite interface {
SetupSuite()
}
SetupAllSuite has a SetupSuite method, which will run before the benchmarks in the suite are run.
type SetupBenchmarkSuite ¶
type SetupBenchmarkSuite interface {
SetupBenchmark()
}
SetupBenchmarkSuite has a SetupBenchmark method, which will run before each benchmark in the suite.
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Suite is a basic testing suite with methods for storing and retrieving the current *testing.B context.
type TearDownAllSuite ¶
type TearDownAllSuite interface {
TearDownSuite()
}
TearDownAllSuite has a TearDownSuite method, which will run after all the benchmarks in the suite have been run.
type TearDownBenchmarkSuite ¶
type TearDownBenchmarkSuite interface {
TearDownBenchmark()
}
TearDownBenchmarkSuite has a TearDownBenchmark method, which will run after each benchmark in the suite.