testeng

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion  = 1
	MaxLogBytes    = 64 * 1024
	DefaultTimeout = 2 * time.Minute
)
View Source
const (
	StatusVerified       = "VERIFIED"
	StatusFailed         = "FAILED"
	StatusIncomplete     = "VERIFICATION_INCOMPLETE"
	StatusTimeout        = "TEST_TIMEOUT"
	StatusUnsupported    = "UNSUPPORTED_PROJECT"
	StatusInfrastructure = "INFRASTRUCTURE_ERROR"
	StatusManual         = "MANUAL_VERIFICATION_REQUIRED"
)

Overall status values.

View Source
const (
	OutcomePass    = "PASS"
	OutcomeFail    = "FAIL"
	OutcomeTimeout = "TIMEOUT"
	OutcomeSkip    = "SKIP"
	OutcomeManual  = "MANUAL_VERIFICATION_REQUIRED"
	OutcomeError   = "ERROR"
	OutcomeCovered = "COVERED_BY_PROJECT_TESTS"
	OutcomeIgnored = "IGNORED"
)

Check outcomes.

View Source
const (
	KindGoTest     = "go_test"
	KindTestID     = "test_id"
	KindAcceptance = "acceptance"
	KindFileExists = "file_exists"
	KindGoSymbol   = "go_symbol"
	KindDoD        = "dod"
	KindMalformed  = "malformed_test_config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	ID         string  `json:"id"`
	Kind       string  `json:"kind"`
	Name       string  `json:"name"`
	Required   bool    `json:"required"`
	Command    Command `json:"command,omitempty"`
	Outcome    string  `json:"outcome,omitempty"`
	Detail     string  `json:"detail,omitempty"`
	ExitCode   int     `json:"exit_code,omitempty"`
	DurationMS int64   `json:"duration_ms,omitempty"`
	StdoutRef  string  `json:"stdout_ref,omitempty"`
	StderrRef  string  `json:"stderr_ref,omitempty"`
	Stdout     string  `json:"-"`
	Stderr     string  `json:"-"`
}

Check is one planned or executed verification step.

type Command

type Command struct {
	Program string   `json:"program"`
	Args    []string `json:"args,omitempty"`
}

Command is a structured subprocess (never a PRD shell string).

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func New

func New(opts Options) *Engine

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, req Request) Result

Run executes the verification plan. It does not diagnose or repair.

type Options

type Options struct {
	Git      *vcs.Client
	Runner   *proc.Runner
	LookPath func(file string) (string, error)
	Now      func() time.Time
	Timeout  time.Duration
}

Options injects process, PATH, and clock dependencies.

type Plan

type Plan struct {
	ProjectRoot string  `json:"project_root"`
	TaskID      string  `json:"task_id"`
	PhaseID     string  `json:"phase_id"`
	Kind        string  `json:"project_kind"`
	Checks      []Check `json:"checks"`
}

Plan is the deterministic verification plan. It does not execute tests.

func BuildPlan

func BuildPlan(root string, pkt packet.Packet) Plan

BuildPlan is deterministic. It does not invent tests and does not execute PRD shell strings.

type Request

type Request struct {
	ProductRoot     string
	Packet          packet.Packet
	RunID           string
	TaskID          string
	PhaseID         string
	BaselineSHA     string
	Jail            *fsguard.Jail
	ManualConfirmed bool
}

Request is one independent verification of a prepared packet.

type Result

type Result struct {
	SchemaVersion                       int      `json:"schema_version"`
	Status                              string   `json:"status"`
	RunID                               string   `json:"run_id,omitempty"`
	TaskID                              string   `json:"task_id,omitempty"`
	PhaseID                             string   `json:"phase_id,omitempty"`
	Timestamp                           string   `json:"timestamp"`
	BaselineSHA                         string   `json:"baseline_sha,omitempty"`
	HeadSHA                             string   `json:"head_sha,omitempty"`
	ChangedFiles                        []string `json:"changed_files,omitempty"`
	UntrackedFiles                      []string `json:"untracked_files,omitempty"`
	DeletedFiles                        []string `json:"deleted_files,omitempty"`
	Plan                                Plan     `json:"plan"`
	Checks                              []Check  `json:"checks"`
	Failures                            []string `json:"failures,omitempty"`
	TestsPass                           bool     `json:"tests_pass"`
	AllVerifiableAcceptanceCriteriaPass bool     `json:"all_verifiable_acceptance_criteria_pass"`
	ManualVerificationRequired          bool     `json:"manual_verification_required"`
	VerifiedSuccess                     bool     `json:"verified_success"`
	Reason                              string   `json:"reason,omitempty"`
}

Result is independent of worker_claimed_success.

Jump to

Keyboard shortcuts

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