testing

package
v0.0.0-...-d500d3c Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDashboardCell

func AddDashboardCell(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

AddDashboardCell testing

func AddLogEntry

func AddLogEntry(
	init func(KeyValueLogFields, *testing.T) (platform.KeyValueLog, func()),
	t *testing.T,
)

AddLogEntry tests the AddLogEntry for the KeyValueLog contract

func AddTarget

func AddTarget(
	init func(TargetFields, *testing.T) (platform.ScraperTargetStoreService, string, func()),
	t *testing.T,
)

AddTarget testing.

func AuthorizationService

func AuthorizationService(
	init func(AuthorizationFields, *testing.T) (platform.AuthorizationService, string, func()), t *testing.T,
)

AuthorizationService tests all the service functions.

func BasicAuth

func BasicAuth(
	init func(UserFields, *testing.T) (platform.BasicAuthService, func()),
	t *testing.T)

BasicAuth test all the services for basic auth

func BucketService

func BucketService(
	init func(BucketFields, *testing.T) (platform.BucketService, string, func()),
	t *testing.T,
)

BucketService tests all the service functions.

func CleanupDBRPMappings

func CleanupDBRPMappings(ctx context.Context, s platform.DBRPMappingService) error

CleanupDBRPMappings finds and removes all dbrp mappings

func CompareAndSetPassword

func CompareAndSetPassword(
	init func(UserFields, *testing.T) (platform.BasicAuthService, func()),
	t *testing.T)

CompareAndSetPassword test

func CreateAuthorization

func CreateAuthorization(
	init func(AuthorizationFields, *testing.T) (platform.AuthorizationService, string, func()),
	t *testing.T,
)

CreateAuthorization testing

func CreateBucket

func CreateBucket(
	init func(BucketFields, *testing.T) (platform.BucketService, string, func()),
	t *testing.T,
)

CreateBucket testing

func CreateDBRPMapping

func CreateDBRPMapping(
	init func(DBRPMappingFields, *testing.T) (platform.DBRPMappingService, func()),
	t *testing.T,
)

CreateDBRPMapping testing

func CreateDashboard

func CreateDashboard(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

CreateDashboard testing

func CreateLabel

func CreateLabel(
	init func(LabelFields, *testing.T) (platform.LabelService, string, func()),
	t *testing.T,
)

func CreateMacro

func CreateMacro(init func(MacroFields, *testing.T) (platform.MacroService, string, func()), t *testing.T)

CreateMacro tests platform.MacroService CreateMacro interface method

func CreateOrganization

func CreateOrganization(
	init func(OrganizationFields, *testing.T) (platform.OrganizationService, string, func()),
	t *testing.T,
)

CreateOrganization testing

func CreateSession

func CreateSession(
	init func(SessionFields, *testing.T) (platform.SessionService, string, func()),
	t *testing.T,
)

CreateSession testing

func CreateSource

func CreateSource(
	init func(SourceFields, *testing.T) (platform.SourceService, string, func()),
	t *testing.T,
)

CreateSource testing

func CreateTelegrafConfig

func CreateTelegrafConfig(
	init func(TelegrafConfigFields, *testing.T) (platform.TelegrafConfigStore, func()),
	t *testing.T,
)

CreateTelegrafConfig testing.

func CreateUser

func CreateUser(
	init func(UserFields, *testing.T) (platform.UserService, string, func()),
	t *testing.T,
)

CreateUser testing

func CreateUserResourceMapping

func CreateUserResourceMapping(
	init func(UserResourceFields, *testing.T) (platform.UserResourceMappingService, func()),
	t *testing.T,
)

func CreateView

func CreateView(
	init func(ViewFields, *testing.T) (platform.ViewService, string, func()),
	t *testing.T,
)

CreateView testing

func DashboardService

func DashboardService(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()), t *testing.T,
)

DashboardService tests all the service functions.

func DeleteAuthorization

func DeleteAuthorization(
	init func(AuthorizationFields, *testing.T) (platform.AuthorizationService, string, func()),
	t *testing.T,
)

DeleteAuthorization testing

func DeleteBucket

func DeleteBucket(
	init func(BucketFields, *testing.T) (platform.BucketService, string, func()),
	t *testing.T,
)

DeleteBucket testing

func DeleteDBRPMapping

func DeleteDBRPMapping(
	init func(DBRPMappingFields, *testing.T) (platform.DBRPMappingService, func()),
	t *testing.T,
)

DeleteDBRPMapping testing

func DeleteDashboard

func DeleteDashboard(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

DeleteDashboard testing

func DeleteLabel

func DeleteLabel(
	init func(LabelFields, *testing.T) (platform.LabelService, string, func()),
	t *testing.T,
)

func DeleteMacro

func DeleteMacro(init func(MacroFields, *testing.T) (platform.MacroService, string, func()), t *testing.T)

DeleteMacro tests platform.MacroService DeleteMacro interface method

func DeleteOrganization

func DeleteOrganization(
	init func(OrganizationFields, *testing.T) (platform.OrganizationService, string, func()),
	t *testing.T,
)

DeleteOrganization testing

func DeleteSecrets

func DeleteSecrets(
	init func(f SecretServiceFields, t *testing.T) (platform.SecretService, func()),
	t *testing.T,
)

DeleteSecrets tests the DeleteSecrets method for the SecretService interface.

func DeleteSource

func DeleteSource(
	init func(SourceFields, *testing.T) (platform.SourceService, string, func()),
	t *testing.T,
)

DeleteSource testing

func DeleteTelegrafConfig

func DeleteTelegrafConfig(
	init func(TelegrafConfigFields, *testing.T) (platform.TelegrafConfigStore, func()),
	t *testing.T,
)

DeleteTelegrafConfig testing.

func DeleteUser

func DeleteUser(
	init func(UserFields, *testing.T) (platform.UserService, string, func()),
	t *testing.T,
)

DeleteUser testing

func DeleteUserResourceMapping

func DeleteUserResourceMapping(
	init func(UserResourceFields, *testing.T) (platform.UserResourceMappingService, func()),
	t *testing.T,
)

func DeleteView

func DeleteView(
	init func(ViewFields, *testing.T) (platform.ViewService, string, func()),
	t *testing.T,
)

DeleteView testing

func ExpireSession

func ExpireSession(
	init func(SessionFields, *testing.T) (platform.SessionService, string, func()),
	t *testing.T,
)

ExpireSession testing

func FindAuthorizationByID

func FindAuthorizationByID(
	init func(AuthorizationFields, *testing.T) (platform.AuthorizationService, string, func()),
	t *testing.T,
)

FindAuthorizationByID testing

func FindAuthorizationByToken

func FindAuthorizationByToken(
	init func(AuthorizationFields, *testing.T) (platform.AuthorizationService, string, func()),
	t *testing.T,
)

FindAuthorizationByToken testing

func FindAuthorizations

func FindAuthorizations(
	init func(AuthorizationFields, *testing.T) (platform.AuthorizationService, string, func()),
	t *testing.T,
)

FindAuthorizations testing

func FindBucket

func FindBucket(
	init func(BucketFields, *testing.T) (platform.BucketService, string, func()),
	t *testing.T,
)

FindBucket testing

func FindBucketByID

func FindBucketByID(
	init func(BucketFields, *testing.T) (platform.BucketService, string, func()),
	t *testing.T,
)

FindBucketByID testing

func FindBuckets

func FindBuckets(
	init func(BucketFields, *testing.T) (platform.BucketService, string, func()),
	t *testing.T,
)

FindBuckets testing

func FindDBRPMapping

func FindDBRPMapping(
	init func(DBRPMappingFields, *testing.T) (platform.DBRPMappingService, func()),
	t *testing.T,
)

FindDBRPMapping testing

func FindDBRPMappingByKey

func FindDBRPMappingByKey(
	init func(DBRPMappingFields, *testing.T) (platform.DBRPMappingService, func()),
	t *testing.T,
)

FindDBRPMappingByKey testing

func FindDBRPMappings

func FindDBRPMappings(
	init func(DBRPMappingFields, *testing.T) (platform.DBRPMappingService, func()),
	t *testing.T,
)

FindDBRPMappings testing

func FindDashboardByID

func FindDashboardByID(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

FindDashboardByID testing

func FindDashboards

func FindDashboards(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

FindDashboards testing

func FindLabels

func FindLabels(
	init func(LabelFields, *testing.T) (platform.LabelService, string, func()),
	t *testing.T,
)

func FindMacroByID

func FindMacroByID(init func(MacroFields, *testing.T) (platform.MacroService, string, func()), t *testing.T)

FindMacroByID tests platform.MacroService FindMacroByID interface method

func FindOrganization

func FindOrganization(
	init func(OrganizationFields, *testing.T) (platform.OrganizationService, string, func()),
	t *testing.T,
)

FindOrganization testing

func FindOrganizationByID

func FindOrganizationByID(
	init func(OrganizationFields, *testing.T) (platform.OrganizationService, string, func()),
	t *testing.T,
)

FindOrganizationByID testing

func FindOrganizations

func FindOrganizations(
	init func(OrganizationFields, *testing.T) (platform.OrganizationService, string, func()),
	t *testing.T,
)

FindOrganizations testing

func FindSession

func FindSession(
	init func(SessionFields, *testing.T) (platform.SessionService, string, func()),
	t *testing.T,
)

FindSession testing

func FindSourceByID

func FindSourceByID(
	init func(SourceFields, *testing.T) (platform.SourceService, string, func()),
	t *testing.T,
)

FindSourceByID testing

func FindSources

func FindSources(
	init func(SourceFields, *testing.T) (platform.SourceService, string, func()),
	t *testing.T,
)

FindSources testing

func FindTelegrafConfig

func FindTelegrafConfig(
	init func(TelegrafConfigFields, *testing.T) (platform.TelegrafConfigStore, func()),
	t *testing.T,
)

FindTelegrafConfig testing

func FindTelegrafConfigByID

func FindTelegrafConfigByID(
	init func(TelegrafConfigFields, *testing.T) (platform.TelegrafConfigStore, func()),
	t *testing.T,
)

FindTelegrafConfigByID testing.

func FindTelegrafConfigs

func FindTelegrafConfigs(
	init func(TelegrafConfigFields, *testing.T) (platform.TelegrafConfigStore, func()),
	t *testing.T,
)

FindTelegrafConfigs testing

func FindUser

func FindUser(
	init func(UserFields, *testing.T) (platform.UserService, string, func()),
	t *testing.T,
)

FindUser testing

func FindUserByID

func FindUserByID(
	init func(UserFields, *testing.T) (platform.UserService, string, func()),
	t *testing.T,
)

FindUserByID testing

func FindUserResourceMappings

func FindUserResourceMappings(
	init func(UserResourceFields, *testing.T) (platform.UserResourceMappingService, func()),
	t *testing.T,
)

func FindUsers

func FindUsers(
	init func(UserFields, *testing.T) (platform.UserService, string, func()),
	t *testing.T,
)

FindUsers testing

func FindViewByID

func FindViewByID(
	init func(ViewFields, *testing.T) (platform.ViewService, string, func()),
	t *testing.T,
)

FindViewByID testing

func FindViews

func FindViews(
	init func(ViewFields, *testing.T) (platform.ViewService, string, func()),
	t *testing.T,
)

FindViews testing

func FirstLogEntry

func FirstLogEntry(
	init func(KeyValueLogFields, *testing.T) (platform.KeyValueLog, func()),
	t *testing.T,
)

FirstLogEntry tests the FirstLogEntry method for the KeyValueLog contract.

func ForEachLogEntry

func ForEachLogEntry(
	init func(KeyValueLogFields, *testing.T) (platform.KeyValueLog, func()),
	t *testing.T,
)

ForEachLogEntry tests the AddLogEntry for the KeyValueLog contract

func Generate

func Generate(
	init func(OnboardingFields, *testing.T) (platform.OnboardingService, func()),
	t *testing.T,
)

Generate testing

func GetDashboardCellView

func GetDashboardCellView(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

GetDashboardCellView is the conformance test for the retrieving a dashboard cell.

func GetSecretKeys

func GetSecretKeys(
	init func(f SecretServiceFields, t *testing.T) (platform.SecretService, func()),
	t *testing.T,
)

GetSecretKeys tests the GetSecretKeys method for the SecretService interface.

func GetTargetByID

func GetTargetByID(
	init func(TargetFields, *testing.T) (platform.ScraperTargetStoreService, string, func()),
	t *testing.T,
)

GetTargetByID testing

func KVConcurrentUpdate

func KVConcurrentUpdate(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVConcurrentUpdate tests concurrent calls to update.

func KVCursor

func KVCursor(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVCursor tests the cursor contract for the key value store.

func KVDelete

func KVDelete(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVDelete tests the delete method contract for the key value store.

func KVGet

func KVGet(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVGet tests the get method contract for the key value store.

func KVPut

func KVPut(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVPut tests the get method contract for the key value store.

func KVStore

func KVStore(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVStore tests the key value store contract

func KVUpdate

func KVUpdate(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVUpdate tests the update method contract for the key value store.

func KVView

func KVView(
	init func(KVStoreFields, *testing.T) (kv.Store, func()),
	t *testing.T,
)

KVView tests the view method contract for the key value store.

func KeyValueLog

func KeyValueLog(
	init func(KeyValueLogFields, *testing.T) (platform.KeyValueLog, func()), t *testing.T,
)

KeyValueLog tests all the service functions.

func LabelService

func LabelService(
	init func(LabelFields, *testing.T) (platform.LabelService, string, func()),
	t *testing.T,
)

LabelService tests all the service functions.

func LastLogEntry

func LastLogEntry(
	init func(KeyValueLogFields, *testing.T) (platform.KeyValueLog, func()),
	t *testing.T,
)

LastLogEntry tests the LastLogEntry method for the KeyValueLog contract.

func ListTargets

func ListTargets(
	init func(TargetFields, *testing.T) (platform.ScraperTargetStoreService, string, func()),
	t *testing.T,
)

ListTargets testing

func LoadSecret

func LoadSecret(
	init func(f SecretServiceFields, t *testing.T) (platform.SecretService, func()),
	t *testing.T,
)

LoadSecret tests the LoadSecret method for the SecretService interface.

func MacroService

func MacroService(
	init func(MacroFields, *testing.T) (platform.MacroService, string, func()), t *testing.T,
)

MacroService tests all the service functions.

func MustIDBase16

func MustIDBase16(s string) platform.ID

MustIDBase16 is an helper to ensure a correct ID is built during testing.

func OrganizationService

func OrganizationService(
	init func(OrganizationFields, *testing.T) (platform.OrganizationService, string, func()), t *testing.T,
)

OrganizationService tests all the service functions.

func PatchSecrets

func PatchSecrets(
	init func(f SecretServiceFields, t *testing.T) (platform.SecretService, func()),
	t *testing.T,
)

PatchSecrets tests the PatchSecrets method for the SecretService interface.

func PutSecret

func PutSecret(
	init func(f SecretServiceFields, t *testing.T) (platform.SecretService, func()),
	t *testing.T,
)

PutSecret tests the PutSecret method for the SecretService interface.

func PutSecrets

func PutSecrets(
	init func(f SecretServiceFields, t *testing.T) (platform.SecretService, func()),
	t *testing.T,
)

PutSecrets tests the PutSecrets method for the SecretService interface.

func RemoveDashboardCell

func RemoveDashboardCell(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

RemoveDashboardCell testing

func RemoveTarget

func RemoveTarget(init func(TargetFields, *testing.T) (platform.ScraperTargetStoreService, string, func()),
	t *testing.T)

RemoveTarget testing

func ReplaceDashboardCells

func ReplaceDashboardCells(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

ReplaceDashboardCells testing

func ScraperService

func ScraperService(
	init func(TargetFields, *testing.T) (platform.ScraperTargetStoreService, string, func()), t *testing.T,
)

ScraperService tests all the service functions.

func SecretService

func SecretService(
	init func(SecretServiceFields, *testing.T) (platform.SecretService, func()),
	t *testing.T,
)

SecretService will test all methods for the secrets service.

func SessionService

func SessionService(
	init func(SessionFields, *testing.T) (platform.SessionService, string, func()), t *testing.T,
)

SessionService tests all the service functions.

func TelegrafConfigStore

func TelegrafConfigStore(
	init func(TelegrafConfigFields, *testing.T) (platform.TelegrafConfigStore, func()), t *testing.T,
)

TelegrafConfigStore tests all the service functions.

func UpdateAuthorizationStatus

func UpdateAuthorizationStatus(
	init func(AuthorizationFields, *testing.T) (platform.AuthorizationService, string, func()),
	t *testing.T,
)

UpdateAuthorizationStatus testing

func UpdateBucket

func UpdateBucket(
	init func(BucketFields, *testing.T) (platform.BucketService, string, func()),
	t *testing.T,
)

UpdateBucket testing

func UpdateDashboard

func UpdateDashboard(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

UpdateDashboard testing

func UpdateDashboardCell

func UpdateDashboardCell(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

UpdateDashboardCell testing

func UpdateDashboardCellView

func UpdateDashboardCellView(
	init func(DashboardFields, *testing.T) (platform.DashboardService, string, func()),
	t *testing.T,
)

UpdateDashboardCellView is the conformance test for the updating a dashboard cell.

func UpdateLabel

func UpdateLabel(
	init func(LabelFields, *testing.T) (platform.LabelService, string, func()),
	t *testing.T,
)

func UpdateMacro

func UpdateMacro(init func(MacroFields, *testing.T) (platform.MacroService, string, func()), t *testing.T)

UpdateMacro tests platform.MacroService UpdateMacro interface method

func UpdateOrganization

func UpdateOrganization(
	init func(OrganizationFields, *testing.T) (platform.OrganizationService, string, func()),
	t *testing.T,
)

UpdateOrganization testing

func UpdateTarget

func UpdateTarget(
	init func(TargetFields, *testing.T) (platform.ScraperTargetStoreService, string, func()),
	t *testing.T,
)

UpdateTarget testing

func UpdateTelegrafConfig

func UpdateTelegrafConfig(
	init func(TelegrafConfigFields, *testing.T) (platform.TelegrafConfigStore, func()),
	t *testing.T,
)

UpdateTelegrafConfig testing.

func UpdateUser

func UpdateUser(
	init func(UserFields, *testing.T) (platform.UserService, string, func()),
	t *testing.T,
)

UpdateUser testing

func UpdateView

func UpdateView(
	init func(ViewFields, *testing.T) (platform.ViewService, string, func()),
	t *testing.T,
)

UpdateView testing

func UserResourceMappingService

func UserResourceMappingService(
	init func(UserResourceFields, *testing.T) (platform.UserResourceMappingService, func()),
	t *testing.T,
)

UserResourceMappingService tests all the service functions.

func UserService

func UserService(
	init func(UserFields, *testing.T) (platform.UserService, string, func()), t *testing.T,
)

UserService tests all the service functions.

Types

type AuthorizationFields

type AuthorizationFields struct {
	IDGenerator    platform.IDGenerator
	TokenGenerator platform.TokenGenerator
	Authorizations []*platform.Authorization
	Users          []*platform.User
	Orgs           []*platform.Organization
}

AuthorizationFields will include the IDGenerator, and authorizations

type BucketFields

type BucketFields struct {
	IDGenerator   platform.IDGenerator
	Buckets       []*platform.Bucket
	Organizations []*platform.Organization
}

BucketFields will include the IDGenerator, and buckets

type DBRPMappingFields

type DBRPMappingFields struct {
	DBRPMappings []*platform.DBRPMapping
}

DBRPMappingFields will include the dbrpMappings

func (DBRPMappingFields) Populate

Populate creates all entities in DBRPMappingFields

type DashboardFields

type DashboardFields struct {
	IDGenerator platform.IDGenerator
	NowFn       func() time.Time
	Dashboards  []*platform.Dashboard
	Views       []*platform.View
}

DashboardFields will include the IDGenerator, and dashboards

type KVStoreFields

type KVStoreFields struct {
	Bucket []byte
	Pairs  []kv.Pair
}

KVStoreFields are background data that has to be set before the test runs.

type KeyValueLogFields

type KeyValueLogFields struct {
	LogEntries []LogEntry
}

KeyValueLogFields will include the IDGenerator, and keyValueLogs

type LabelFields

type LabelFields struct {
	Labels []*platform.Label
}

type LogEntry

type LogEntry struct {
	Key   []byte
	Value []byte
	Time  time.Time
}

A log entry is a comparable data structure that is used for testing

type MacroFields

type MacroFields struct {
	Macros      []*platform.Macro
	IDGenerator platform.IDGenerator
}

MacroFields defines fields for a macro test

type OnboardingFields

type OnboardingFields struct {
	IDGenerator    platform.IDGenerator
	TokenGenerator platform.TokenGenerator
	IsOnboarding   bool
}

OnboardingFields will include the IDGenerator, TokenGenerator and IsOnboarding

type OrganizationFields

type OrganizationFields struct {
	IDGenerator   platform.IDGenerator
	Organizations []*platform.Organization
}

OrganizationFields will include the IDGenerator, and organizations

type Secret

type Secret struct {
	OrganizationID platform.ID
	Env            map[string]string
}

A secret is a comparable data structure that is used for testing

type SecretServiceFields

type SecretServiceFields struct {
	Secrets []Secret
}

SecretServiceFields contain the

type SessionFields

type SessionFields struct {
	IDGenerator    platform.IDGenerator
	TokenGenerator platform.TokenGenerator
	Sessions       []*platform.Session
	Users          []*platform.User
}

SessionFields will include the IDGenerator, TokenGenerator, Sessions, and Users

type SourceFields

type SourceFields struct {
	IDGenerator platform.IDGenerator
	Sources     []*platform.Source
}

SourceFields will include the IDGenerator, and sources

type TargetFields

type TargetFields struct {
	IDGenerator platform.IDGenerator
	Targets     []*platform.ScraperTarget
}

TargetFields will include the IDGenerator, and targets

type TelegrafConfigFields

type TelegrafConfigFields struct {
	IDGenerator          platform.IDGenerator
	TelegrafConfigs      []*platform.TelegrafConfig
	UserResourceMappings []*platform.UserResourceMapping
}

TelegrafConfigFields includes prepopulated data for mapping tests.

type UserFields

type UserFields struct {
	IDGenerator platform.IDGenerator
	Users       []*platform.User
}

UserFields will include the IDGenerator, and users

type UserResourceFields

type UserResourceFields struct {
	UserResourceMappings []*platform.UserResourceMapping
}

UserResourceFields includes prepopulated data for mapping tests

type ViewFields

type ViewFields struct {
	IDGenerator platform.IDGenerator
	Views       []*platform.View
}

ViewFields will include the IDGenerator, and views

Jump to

Keyboard shortcuts

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