helper

package
v0.0.0-...-33ab173 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurToPtr

func DurToPtr(v time.Duration) *time.Duration

DurToPtr returns the pointer of the given time.Duration

func IntToPtr

func IntToPtr(v int) *int

IntToPtr returns the pointer of the given int

func PrintCheckPoint

func PrintCheckPoint(testCase, message string, a ...interface{})

PrintCheckPoint simple helper for printing check-points.

func SendScaleAlert

func SendScaleAlert(sokarAddr, alertName string, fire bool) error

SendScaleAlert sends a alert with the given name to sokar. Either the alert is firing (fire == true) or is expired (fire == false).

func ServerAddresses

func ServerAddresses() (sokarAddr string, nomadAddr string)

func StrToPtr

func StrToPtr(v string) *string

StrToPtr returns the pointer of the given string

func WaitForNomad

func WaitForNomad(t *testing.T, nomadAddr string, timeoutBetweenTries time.Duration, numTries int) (string, error)

WaitForNomad wait until nomad is up and running

func WaitForSokar

func WaitForSokar(t *testing.T, serviceAddr string, timeoutBetweenTries time.Duration, numTries int) error

WaitForSokar wait until sokar is up and running

Types

type JobAsserter

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

JobAsserter helps on different assertion tasks. Especially those where multiple retries have to be done before considering a test as failed.

func NewJobAsserter

func NewJobAsserter(t *testing.T, jobName string, waitTime time.Duration, maxTries int) *JobAsserter

NewJobAsserter creates a new JobAsserter

func (*JobAsserter) AssertJobCount

func (ja *JobAsserter) AssertJobCount(expectedJobCount int, jobName string, obtainJobCountFunc func(jobName string) (int, error))

AssertJobCount asserts that the count of the nomad job is as expected

Jump to

Keyboard shortcuts

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