console

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 79

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bluef added in v1.2.0

func Bluef(msg string, args ...interface{}) string

Bluef prints and formats msg as red text

func DarkF added in v1.2.0

func DarkF(msg string, args ...interface{}) string

DarkWhitef prints and formats msg as dark white

func Grayf added in v1.2.0

func Grayf(msg string, args ...interface{}) string

Grayf prints and formats msg as red text

func Greenf

func Greenf(msg string, args ...interface{}) string

Greenf prints and formats msg as green text

func LightCyanf

func LightCyanf(msg string, args ...interface{}) string

LightCyanf prints and formats msg as light cyan text

func LightGreenf

func LightGreenf(msg string, args ...interface{}) string

LightGreenf prints and formats msg as light green text

func LightRedf added in v1.2.0

func LightRedf(msg string, args ...interface{}) string

LightRedf prints and formats msg as red text

func Magentaf added in v1.2.0

func Magentaf(msg string, args ...interface{}) string

Magentaf prints and formats msg as green text

func Redf

func Redf(msg string, args ...interface{}) string

Redf prints and formats msg as red text

func StripSecrets

func StripSecrets(text string) string

StripSecrets takes a YAML or INI formatted text and removes any potentially secret data as denoted by keys containing "pass" or "secret" or exact matches for "key" the last character of the secret is kept to aid in troubleshooting

func Yellowf added in v1.2.0

func Yellowf(msg string, args ...interface{}) string

Yellowf prints and formats msg as red text

Types

type JUnitFailure

type JUnitFailure struct {
	Message  string `xml:"message,attr"`
	Type     string `xml:"type,attr"`
	Contents string `xml:",chardata"`
}

JUnitFailure contains data related to a failed test.

type JUnitProperty

type JUnitProperty struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

JUnitProperty represents a key/value pair used to define properties.

type JUnitSkipMessage

type JUnitSkipMessage struct {
	Message string `xml:"message,attr"`
}

JUnitSkipMessage contains the reason why a testcase was skipped.

type JUnitTestCase

type JUnitTestCase struct {
	XMLName     xml.Name          `xml:"testcase"`
	Classname   string            `xml:"classname,attr"`
	Name        string            `xml:"name,attr"`
	Time        string            `xml:"time,attr"`
	SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
	Failure     *JUnitFailure     `xml:"failure,omitempty"`
}

JUnitTestCase is a single test case with its result.

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName    xml.Name        `xml:"testsuite"`
	Tests      int             `xml:"tests,attr"`
	Failures   int             `xml:"failures,attr"`
	Time       string          `xml:"time,attr"`
	Name       string          `xml:"name,attr"`
	Properties []JUnitProperty `xml:"properties>property,omitempty"`
	TestCases  []JUnitTestCase `xml:"testcase"`
}

JUnitTestSuite is a single JUnit test suite which may contain many testcases.

type JUnitTestSuites

type JUnitTestSuites struct {
	XMLName xml.Name         `xml:"testsuites"`
	Suites  []JUnitTestSuite `xml:"testsuite"`
}

JUnitTestSuites is a collection of JUnit test suites.

func (JUnitTestSuites) ToXML

func (suites JUnitTestSuites) ToXML() (string, error)

type Progress added in v1.2.0

type Progress interface {
	Done()
	Status(status string)
	Start()
}

func NewTerminalProgress added in v1.2.0

func NewTerminalProgress(name string, localTest *TestResults, progress *mpb.Progress) Progress

func NewTextProgress added in v1.2.0

func NewTextProgress(name string, localTest *TestResults) Progress

type TestResults

type TestResults struct {
	PassCount int
	FailCount int
	SkipCount int
	Tests     []JUnitTestCase
	Name      string
	Writer    io.Writer
	Retries   int
}

TestResults contains the status of testing

func NewTestResults added in v1.2.0

func NewTestResults(name string, writer io.Writer) TestResults

func (*TestResults) Append added in v1.2.0

func (c *TestResults) Append(other *TestResults)

func (*TestResults) Debugf added in v1.2.0

func (c *TestResults) Debugf(s string, args ...interface{})

func (*TestResults) Done

func (c *TestResults) Done()

Done prints the test results to stdout

func (*TestResults) Errorf added in v1.2.0

func (c *TestResults) Errorf(s string, args ...interface{})

func (*TestResults) Failf

func (c *TestResults) Failf(name, msg string, args ...interface{})

Failf reports a new failing test

func (*TestResults) Infof added in v1.2.0

func (c *TestResults) Infof(s string, args ...interface{})

func (*TestResults) Passf

func (c *TestResults) Passf(name, msg string, args ...interface{})

Passf reports a new passing test

func (*TestResults) Printf added in v1.2.0

func (c *TestResults) Printf(s string, args ...interface{})

func (*TestResults) Println added in v1.2.0

func (c *TestResults) Println(s string)

func (*TestResults) Retry added in v1.2.0

func (c *TestResults) Retry()

func (*TestResults) Skipf

func (c *TestResults) Skipf(name, msg string, args ...interface{})

Skipf reports a new skipped test

func (TestResults) String

func (c TestResults) String() string

func (*TestResults) SuiteName

func (c *TestResults) SuiteName(name string) *TestResults

func (TestResults) ToXML

func (c TestResults) ToXML() (string, error)

func (*TestResults) Tracef added in v1.2.0

func (c *TestResults) Tracef(s string, args ...interface{})

func (*TestResults) Warnf added in v1.2.0

func (c *TestResults) Warnf(s string, args ...interface{})

Jump to

Keyboard shortcuts

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