Documentation
¶
Overview ¶
Package runner tracks test stability and quarantine decisions.
Index ¶
- type DockerSandbox
- type QuarantineStore
- func (q *QuarantineStore) Close() error
- func (q *QuarantineStore) Quarantined(ctx context.Context, testName string, threshold float64) (bool, float64, error)
- func (q *QuarantineStore) QuarantinedForHash(ctx context.Context, testName, astHash string, threshold float64) (bool, float64, error)
- func (q *QuarantineStore) QuarantinedTests(ctx context.Context, threshold float64) ([]string, error)
- func (q *QuarantineStore) Record(ctx context.Context, testName string, passed bool, at time.Time) error
- func (q *QuarantineStore) RecordForHash(ctx context.Context, testName, astHash string, passed bool, at time.Time) error
- func (q *QuarantineStore) Score(ctx context.Context, testName string) (float64, error)
- func (q *QuarantineStore) ScoreForHash(ctx context.Context, testName, astHash string) (float64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerSandbox ¶
type DockerSandbox struct {
Root string
Image string
ModuleCache string
GoCache string
GoRoot string
TestCommand []string
}
DockerSandbox tests a patch in an ephemeral workspace copy inside a hardened, network-isolated Docker container.
func (DockerSandbox) ApplyAndTest ¶
func (s DockerSandbox) ApplyAndTest(ctx context.Context, diff string) error
ApplyAndTest validates and applies the patch in a disposable copy, then runs the configured command without network, Linux capabilities, or privilege gain.
type QuarantineStore ¶
type QuarantineStore struct {
// contains filtered or unexported fields
}
QuarantineStore stores a bounded rolling history of test outcomes in SQLite.
func OpenQuarantine ¶
func OpenQuarantine(path string, window int) (*QuarantineStore, error)
OpenQuarantine opens or creates the SQLite database at path.
func (*QuarantineStore) Close ¶
func (q *QuarantineStore) Close() error
Close closes the backing database.
func (*QuarantineStore) Quarantined ¶
func (q *QuarantineStore) Quarantined(ctx context.Context, testName string, threshold float64) (bool, float64, error)
Quarantined reports whether the rolling transition rate exceeds threshold.
func (*QuarantineStore) QuarantinedForHash ¶
func (q *QuarantineStore) QuarantinedForHash(ctx context.Context, testName, astHash string, threshold float64) (bool, float64, error)
QuarantinedForHash checks a test's score only for the supplied AST revision.
func (*QuarantineStore) QuarantinedTests ¶
func (q *QuarantineStore) QuarantinedTests(ctx context.Context, threshold float64) ([]string, error)
QuarantinedTests lists names whose rolling transition rate exceeds threshold.
func (*QuarantineStore) Record ¶
func (q *QuarantineStore) Record(ctx context.Context, testName string, passed bool, at time.Time) error
Record appends a test result and trims older history beyond the configured window.
func (*QuarantineStore) RecordForHash ¶
func (q *QuarantineStore) RecordForHash(ctx context.Context, testName, astHash string, passed bool, at time.Time) error
RecordForHash records a result within a test's exact source/AST identity.
func (*QuarantineStore) Score ¶
Score returns the rolling transition rate between pass and fail outcomes.
func (*QuarantineStore) ScoreForHash ¶
func (q *QuarantineStore) ScoreForHash(ctx context.Context, testName, astHash string) (float64, error)
ScoreForHash returns the rolling failure fraction for one exact AST identity. A uniformly failing test is not classified as flaky; both pass and fail observations must occur before the failure fraction is meaningful.