helpers

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestMessage            = "test message "
	TestContainerID        = stringid.GenerateNonCryptoID()
	TestContainerName      = "testcontainer"
	TestContainerShortName = "testcontainershortname"
	TestContainerState     = "testcontainerstate"
	TestServiceID          = stringid.GenerateNonCryptoID()
	TestServiceName        = "testservice"
	TestStackID            = stringid.GenerateNonCryptoID()
	TestStackName          = "teststack"
	TestNodeID             = stringid.GenerateNonCryptoID()
	TestTaskID             = stringid.GenerateNonCryptoID()
)

Log Producer constants

Functions

func AmplifierConnection

func AmplifierConnection() (*grpc.ClientConn, error)

AmplifierConnection returns a grpc connection to amplifier

Types

type Helper

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

Helper is a test helper

func New

func New() (*Helper, error)

New returns a new test helper

func (*Helper) Accounts

func (h *Helper) Accounts() account.AccountClient

Accounts returns an account client

func (*Helper) AddUserToTeam

func (h *Helper) AddUserToTeam(ownerCtx context.Context, t *testing.T, team *account.CreateTeamRequest, user *account.SignUpRequest)

func (*Helper) CreateAndAddUserToOrganization

func (h *Helper) CreateAndAddUserToOrganization(ownerCtx context.Context, t *testing.T, org *account.CreateOrganizationRequest, user *account.SignUpRequest) context.Context

CreateAndAddUserToOrganization signs up and logs in the given user and adds them to the given organization

func (*Helper) CreateOrganization

func (h *Helper) CreateOrganization(t *testing.T, org *account.CreateOrganizationRequest, owner *account.SignUpRequest) context.Context

CreateOrganization signs up and logs in the given user and creates an organization

func (*Helper) CreateTeam

CreateTeam creates the given owner, creates the given organization and creates a team in this organization

func (*Helper) CreateUser

func (h *Helper) CreateUser(t *testing.T, user *account.SignUpRequest) context.Context

CreateUser signs up and logs in the given user

func (*Helper) DefaultOrg added in v0.15.0

func (h *Helper) DefaultOrg() account.CreateOrganizationRequest

DefaultOrg returns the default organization CreateOrganizationRequest

func (*Helper) DeployStack

func (h *Helper) DeployStack(ctx context.Context, name string, composeFile string) (string, error)

DeployStack deploys a stack with given name and file location

func (*Helper) Login

func (h *Helper) Login() (metadata.MD, error)

Login sign-up, verify and log-in a random user and returns the associated credentials

func (*Helper) Logs

func (h *Helper) Logs() logs.LogsClient

Logs returns a log client

func (*Helper) RandomOrg

func (h *Helper) RandomOrg() account.CreateOrganizationRequest

RandomOrg returns a random organization CreateOrganizationRequest

func (*Helper) RandomTeam

func (h *Helper) RandomTeam(org string) account.CreateTeamRequest

RandomTeam returns a random team CreateTeamRequest

func (*Helper) RandomUser

func (h *Helper) RandomUser() account.SignUpRequest

RandomUser returns a random user SignUpRequest

func (*Helper) RemoveUserFromTeam

func (h *Helper) RemoveUserFromTeam(ownerCtx context.Context, t *testing.T, team *account.CreateTeamRequest, user *account.SignUpRequest)

func (*Helper) Resources

func (h *Helper) Resources() resource.ResourceClient

Resources returns a resource client

func (*Helper) Stacks

func (h *Helper) Stacks() stack.StackClient

Stacks returns a stack client

func (*Helper) SuperLogin

func (h *Helper) SuperLogin() (context.Context, error)

SuperLogin logs in as super user and returns the associated credentials

func (*Helper) SuperUser

func (h *Helper) SuperUser() account.SignUpRequest

SuperUser returns the super user SignUpRequest

func (*Helper) Switch

func (h *Helper) Switch(userCtx context.Context, t *testing.T, accountName string) context.Context

Switch switches from the given user context to the given account name

func (*Helper) Tokens

func (h *Helper) Tokens() *auth.Tokens

Tokens returns a token manager instance

type LogProducer

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

LogProducer is a test log producer

func NewLogProducer

func NewLogProducer(h *Helper) *LogProducer

NewLogProducer instantiates a new log producer

func (*LogProducer) PopulateLogs

func (lp *LogProducer) PopulateLogs() error

PopulateLogs populate elasticsearch with log entries, by producing test messages and making sure their got indexed

func (*LogProducer) StartAsyncProducer

func (lp *LogProducer) StartAsyncProducer()

StartAsyncProducer starts producing log messages in the background

func (*LogProducer) StopAsyncProducer

func (lp *LogProducer) StopAsyncProducer()

StopAsyncProducer stops producing log messages in the background

Directories

Path Synopsis
integration
etcd
Package etcd is a generated protocol buffer package.
Package etcd is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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