Documentation ¶
Index ¶
- func AssertDirContentsEqual(t *testing.T, expectedDir string, actualDir string)
- func AssertDirDoesNotExist(t *testing.T, dir string) bool
- func AssertDirExists(t *testing.T, dir string) bool
- func AssertDirsExist(t *testing.T, expected bool, paths ...string)
- func AssertEqualFileText(t *testing.T, expectedFile string, actualFile string) error
- func AssertFileContains(t *testing.T, fileName string, containsText string)
- func AssertFileDoesNotContain(t *testing.T, fileName string, containsText string)
- func AssertFileDoesNotExist(t *testing.T, fileName string) bool
- func AssertFileExists(t *testing.T, fileName string) bool
- func AssertFilesExist(t *testing.T, expected bool, paths ...string)
- func AssertLoadFileText(t *testing.T, fileName string) (string, error)
- func AssertTextFileContentsEqual(t *testing.T, expectedFile string, actualFile string)
- func CreateAuthConfigService() auth.ConfigService
- func Debugf(message string, args ...interface{})
- func ExpectString(t *testing.T, console *expect.Console, s string)
- func IsDebugLog() bool
- func Output() terminal.FileWriter
- func Retry(t *testing.T, maxAttempts int, sleep time.Duration, f func(r *R)) bool
- func SkipForWindows(t *testing.T, reason string)
- func TestCloser(t *testing.T, closer io.Closer)
- func TestShouldDisableMaven() bool
- type ConsoleWrapper
- type R
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDirContentsEqual ¶
AssertDirContentsEqual walks two directory structures and validates that the same files exist (by name) and that they have the same content
func AssertDirDoesNotExist ¶
AssertDirDoesNotExist asserts that the given directory does not exist
func AssertDirExists ¶
AssertDirExists asserts that the given directory exists
func AssertDirsExist ¶
AssertDirsExist asserts that the list of directory paths either exist or don't exist
func AssertEqualFileText ¶
func AssertFileContains ¶
AssertFileContains asserts that a given file exists and contains the given text
func AssertFileDoesNotContain ¶
AssertFileDoesNotContain asserts that a given file exists and does not contain the given text
func AssertFileDoesNotExist ¶
AssertFileDoesNotExist asserts that the given file does not exist
func AssertFileExists ¶
AssertFileExists asserts that the given file exists
func AssertFilesExist ¶
AssertFilesExist asserts that the list of file paths either exist or don't exist
func AssertLoadFileText ¶
AssertLoadFileText asserts that the given file name can be loaded and returns the string contents
func AssertTextFileContentsEqual ¶
AssertTextFileContentsEqual asserts that both the expected and actual files can be loaded as text and that their contents are identical
func CreateAuthConfigService ¶
func CreateAuthConfigService() auth.ConfigService
CreateAuthConfigService creates and returns a fixture ConfigService
func ExpectString ¶
ExpectString does the same as the go-expect console.ExpectString method, but also reports failures to the testing object in a sensible format
func Retry ¶
Retry runs function f for up to maxAttempts times until f returns successfully, and reports whether f was run successfully. It will sleep for the given period between invocations of f. Use the provided *tests.R instead of a *testing.T from the function.
func SkipForWindows ¶
SkipForWindows skips tests if they are running on Windows This is to be used for valid tests that just don't work on windows for whatever reason
func TestShouldDisableMaven ¶
func TestShouldDisableMaven() bool
TestShouldDisableMaven should disable maven
Types ¶
type ConsoleWrapper ¶
ConsoleWrapper is a wrapper around the go-expect Console that takes a test object and will report failures This prevents users having to manually detect and report errors during the tests
func NewTerminal ¶
func NewTerminal(t assert.TestingT, timeout *time.Duration) *ConsoleWrapper
NewTerminal mock terminal to control stdin and stdout
func (*ConsoleWrapper) Cleanup ¶
func (c *ConsoleWrapper) Cleanup()
Cleanup closes all resources the console was using
func (*ConsoleWrapper) CurrentState ¶
func (c *ConsoleWrapper) CurrentState() string
CurrentState gets the last line of text currently on the console
func (*ConsoleWrapper) ExpectEOF ¶
func (c *ConsoleWrapper) ExpectEOF()
ExpectEOF expects an EOF to be present on the console and reports an error if it is not
func (*ConsoleWrapper) ExpectString ¶
func (c *ConsoleWrapper) ExpectString(s string)
ExpectString expects a string to be present on the console and fails the test if it is not
func (*ConsoleWrapper) SendLine ¶
func (c *ConsoleWrapper) SendLine(s string)
SendLine sends a string to the console and fails the test if something goes wrong
type R ¶
type R struct { // The number of current attempt. Attempt int // contains filtered or unexported fields }
R is passed to each run of a flaky test run, manages state and accumulates log statements.