Documentation
¶
Overview ¶
File: internal/reporter/junit.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleReporter ¶
type ConsoleReporter struct {
// contains filtered or unexported fields
}
ConsoleReporter prints test results to the console in a human-readable format. It supports both a standard and a verbose output mode.
func NewConsoleReporter ¶
func NewConsoleReporter(verbose bool) *ConsoleReporter
NewConsoleReporter creates a new console reporter.
func (*ConsoleReporter) Render ¶
func (c *ConsoleReporter) Render()
Render is a no-op for the console reporter.
func (*ConsoleReporter) SuiteFinished ¶
func (c *ConsoleReporter) SuiteFinished()
SuiteFinished is a no-op for the console reporter as no final summary is needed.
func (*ConsoleReporter) SuiteStarted ¶
func (c *ConsoleReporter) SuiteStarted(suite *models.TestSuite)
SuiteStarted prints a header indicating the start of a new test suite.
func (*ConsoleReporter) TestFinished ¶
func (c *ConsoleReporter) TestFinished(result *models.TestResult)
TestFinished prints the result of a single test, including its status (PASS/FAIL) and duration. If the test failed, it also prints the errors.
type JUnitFailure ¶
type JUnitReporter ¶
type JUnitReporter struct {
// contains filtered or unexported fields
}
func NewJUnitReporter ¶
func NewJUnitReporter(outputFile string) *JUnitReporter
func (*JUnitReporter) Render ¶
func (r *JUnitReporter) Render()
func (*JUnitReporter) SuiteFinished ¶
func (r *JUnitReporter) SuiteFinished()
func (*JUnitReporter) SuiteStarted ¶
func (r *JUnitReporter) SuiteStarted(suite *models.TestSuite)
func (*JUnitReporter) TestFinished ¶
func (r *JUnitReporter) TestFinished(result *models.TestResult)
type JUnitTestCase ¶
type JUnitTestSuite ¶
type JUnitTestSuites ¶
type JUnitTestSuites struct {
XMLName xml.Name `xml:"testsuites"`
Suites []JUnitTestSuite `xml:"testsuite"`
}
JUnit structure
type Reporter ¶
type Reporter interface {
// SuiteStarted is called when a new test suite begins.
SuiteStarted(suite *models.TestSuite)
// TestFinished is called after each test case is executed.
TestFinished(result *models.TestResult)
// SuiteFinished is called when a test suite has completed.
SuiteFinished()
// Render is called at the end of the entire test run to generate the final report.
Render()
}
Reporter is the interface that all test reporters must implement. This allows for different output formats, such as console logging or JUnit XML.