Documentation
¶
Index ¶
- func AuthTest(t *testing.T, testFunc func(t *testing.T))
- func CITest(t *testing.T, testFunc func(t *testing.T))
- func FlakeResistant(t *testing.T, testFunc func(t *testing.T))
- func NetworkTest(t *testing.T, testFunc func(t *testing.T))
- func WithRetry(t *testing.T, testName string, config RetryConfig, testFunc RetryTestFunc)
- func WithSimpleRetry(t *testing.T, testName string, testFunc RetryTestFunc)
- type RetryConfig
- type RetryTestFunc
- type TestConfig
- type TestRepositoryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlakeResistant ¶
FlakeResistant marks a test as potentially flaky and applies retry logic
func NetworkTest ¶
NetworkTest marks a test as requiring network access and applies appropriate handling
func WithRetry ¶
func WithRetry(t *testing.T, testName string, config RetryConfig, testFunc RetryTestFunc)
WithRetry executes a test function with retry logic
func WithSimpleRetry ¶
func WithSimpleRetry(t *testing.T, testName string, testFunc RetryTestFunc)
WithSimpleRetry provides a simpler interface for basic retry scenarios
Types ¶
type RetryConfig ¶
type RetryConfig struct {
MaxAttempts int
Delay time.Duration
Backoff float64 // Multiplier for delay between attempts
}
RetryConfig configures test retry behavior
func DefaultRetryConfig ¶
func DefaultRetryConfig() RetryConfig
DefaultRetryConfig returns a sensible default retry configuration
type RetryTestFunc ¶
type RetryTestFunc func() error
RetryTestFunc represents a test function that can be retried
type TestConfig ¶
type TestConfig struct {
SkipNetworkTests bool
SkipAuthTests bool
UseShallowClone bool
DefaultTimeout time.Duration
MaxRetries int
RetryDelay time.Duration
VerboseOutput bool
TestDataDir string
EnableMockRepos bool
GitHubToken string
TestRepositories []TestRepositoryConfig
}
TestConfig provides configuration for E2E tests
func GetTestConfig ¶
func GetTestConfig() *TestConfig
GetTestConfig returns the test configuration based on environment variables
func (*TestConfig) GetTestRepository ¶
func (c *TestConfig) GetTestRepository(name string) *TestRepositoryConfig
GetTestRepository returns a test repository by name
func (*TestConfig) ShouldSkipTest ¶
func (c *TestConfig) ShouldSkipTest(testType string, requiresAuth bool, requiresNetwork bool) (bool, string)
ShouldSkipTest determines if a test should be skipped based on configuration
type TestRepositoryConfig ¶
type TestRepositoryConfig struct {
Name string
URL string
Description string
ExpectedMinFiles int
ExpectedMaxDuration time.Duration
ExpectedPITypes []string
ExpectedMinFindings int
ExpectedMaxFindings int
SkipIfNoAuth bool
RequireAuth bool
}
TestRepositoryConfig configures individual test repositories