types

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormattedFailuresNotification

type FormattedFailuresNotification struct {
	Content string
}

FormattedFailuresNotification is a special notification for RSpec's formatted failure output

func (FormattedFailuresNotification) GetEvent

func (FormattedFailuresNotification) GetTestID

func (n FormattedFailuresNotification) GetTestID() string

type FormattedPendingNotification

type FormattedPendingNotification struct {
	Content string
}

FormattedPendingNotification is a special notification for RSpec's formatted pending output

func (FormattedPendingNotification) GetEvent

func (FormattedPendingNotification) GetTestID

func (n FormattedPendingNotification) GetTestID() string

type FormattedSummaryNotification

type FormattedSummaryNotification struct {
	Content string
}

FormattedSummaryNotification is a special notification for RSpec's formatted summary

func (FormattedSummaryNotification) GetEvent

func (FormattedSummaryNotification) GetTestID

func (n FormattedSummaryNotification) GetTestID() string

type OutputNotification

type OutputNotification struct {
	Event   TestEvent // Always RawOutput
	Content string
}

OutputNotification represents raw output that doesn't match patterns

func (OutputNotification) GetEvent

func (n OutputNotification) GetEvent() TestEvent

func (OutputNotification) GetTestID

func (n OutputNotification) GetTestID() string

type ProgressEvent

type ProgressEvent struct {
	Event     TestEvent // Always Progress
	Character string    // '.', 'F', 'E', 'S'
	Index     int       // Position in test run (0-based)
}

ProgressEvent represents a progress indicator for real-time display only This is not a test result, just a display notification

func (ProgressEvent) GetEvent

func (n ProgressEvent) GetEvent() TestEvent

func (ProgressEvent) GetTestID

func (n ProgressEvent) GetTestID() string

type SuiteNotification

type SuiteNotification struct {
	Event          TestEvent
	TestCount      int
	AssertionCount int // Only populated for minitest
	FailureCount   int
	ErrorCount     int
	PendingCount   int
	LoadTime       time.Duration
	Duration       time.Duration
}

SuiteNotification represents suite-level events

func (SuiteNotification) GetEvent

func (n SuiteNotification) GetEvent() TestEvent

func (SuiteNotification) GetTestID

func (n SuiteNotification) GetTestID() string

type TestCaseNotification

type TestCaseNotification struct {
	Event           TestEvent
	TestID          string
	Description     string
	FullDescription string
	Location        string // e.g. "./spec/foo_spec.rb:42"
	FilePath        string
	LineNumber      int
	Status          string // Original status from framework
	Duration        time.Duration

	// Only populated for failures
	Exception *TestException

	// Only populated for pending tests
	PendingMessage string
}

TestCaseNotification represents events for individual test cases

func (TestCaseNotification) GetEvent

func (n TestCaseNotification) GetEvent() TestEvent

func (TestCaseNotification) GetTestID

func (n TestCaseNotification) GetTestID() string

type TestEvent

type TestEvent string

TestEvent represents the type of test event

const (
	TestPassed    TestEvent = "test_passed"
	TestFailed    TestEvent = "test_failed"
	TestPending   TestEvent = "test_pending"
	TestStarted   TestEvent = "test_started"
	SuiteStarted  TestEvent = "suite_started"
	SuiteFinished TestEvent = "suite_finished"
	RawOutput     TestEvent = "raw_output"
	Progress      TestEvent = "progress" // Progress indicator for real-time display
)

type TestException

type TestException struct {
	Class     string
	Message   string
	Backtrace []string
}

TestException contains failure information

type TestNotification

type TestNotification interface {
	GetEvent() TestEvent
	GetTestID() string
}

TestNotification is the interface that all notifications implement

type TestOutputParser

type TestOutputParser interface {
	// ParseLine parses a single line of output and returns notifications
	// The bool indicates if the line was consumed (should not be included in raw output)
	ParseLine(line string) ([]TestNotification, bool)
	// NotificationToProgress converts a notification to a progress type
	// If the notification is not a progress notification, the second return value is false
	NotificationToProgress(notification TestNotification) (string, bool)
	// FormatSummary formats a test summary in the framework-specific style
	FormatSummary(suite *SuiteNotification, totalExamples int, totalFailures int, totalPending int, wallTime float64, loadTime float64) string
	// FormatFailuresList formats a list of failures with file:line references for re-running
	FormatFailuresList(failures []TestCaseNotification) string
	// ColorizeSummary applies color to a summary based on success/failure state
	ColorizeSummary(summary string, hasFailures bool) string
	// CurrentFile returns the current file being tested (for trace-output)
	CurrentFile() string
}

TestOutputParser is the interface for parsing test framework output

type TestState

type TestState string

TestState represents the state of a test execution

const (
	StateSuccess TestState = "success" // passing
	StateFailed  TestState = "failed"  // failure - i.e. assertion failure
	StateError   TestState = "error"   // error - i.e. exception
)

Jump to

Keyboard shortcuts

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