postgres

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListRunsFilter

type ListRunsFilter struct {
	RunID       string
	Status      string
	ProjectName string
	Marker      string
}

type MarkerInfo

type MarkerInfo struct {
	Marker string `json:"marker"`
	Count  int64  `json:"count"`
}

type PostgresRepository

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

PostgresRepository handles PostgreSQL operations for relational execution data.

func NewPostgresRepository

func NewPostgresRepository(db *gorm.DB, logger *slog.Logger) *PostgresRepository

NewPostgresRepository creates a new PostgreSQL repository.

func (*PostgresRepository) AppendTestError

func (r *PostgresRepository) AppendTestError(ctx context.Context, runID, testID string, attemptIndex int32, errorDoc *m.TestErrorDocument) error

AppendTestError adds an error document to the specified test attempt.

func (*PostgresRepository) AppendTestFailure

func (r *PostgresRepository) AppendTestFailure(ctx context.Context, runID, testID string, attemptIndex int32, failure *m.TestFailureDocument) error

AppendTestFailure adds a failure document to the specified test attempt.

func (*PostgresRepository) DeleteRuns

func (r *PostgresRepository) DeleteRuns(ctx context.Context, runIDs []string) (int64, error)

func (*PostgresRepository) FinalizeRunEnd

func (r *PostgresRepository) FinalizeRunEnd(ctx context.Context, fields m.TestRun) error

FinalizeRunEnd applies terminal state from TestRun to the existing run row.

func (*PostgresRepository) FinalizeRunShardEnd

func (r *PostgresRepository) FinalizeRunShardEnd(ctx context.Context, shard *m.RunShard) (bool, error)

FinalizeRunShardEnd upserts the terminal state of a run shard. When all expected shards have finished, it also upserts the parent run row.

func (*PostgresRepository) FinalizeTestEnd

func (r *PostgresRepository) FinalizeTestEnd(ctx context.Context, test *m.Test, attempt *m.TestAttempt) error

FinalizeTestEnd applies terminal state to the relational test row and current attempt.

func (*PostgresRepository) FindAttachmentByStorageKey

func (r *PostgresRepository) FindAttachmentByStorageKey(ctx context.Context, storageKey string) (map[string]interface{}, error)

func (*PostgresRepository) GetRun added in v0.2.4

func (r *PostgresRepository) GetRun(ctx context.Context, runID string, includeSteps bool) (*m.TestRun, error)

func (*PostgresRepository) GetRuns added in v0.2.4

func (r *PostgresRepository) GetRuns(ctx context.Context, filter ListRunsFilter, limit, offset int64, includeSteps bool) ([]*m.TestRun, int64, error)

func (*PostgresRepository) GetTestTrends

func (r *PostgresRepository) GetTestTrends(ctx context.Context, testID string, limit int64) ([]*TestTrendItem, error)

func (*PostgresRepository) GetUniqueMarkers

func (r *PostgresRepository) GetUniqueMarkers(ctx context.Context) ([]*MarkerInfo, error)

func (*PostgresRepository) IsConfigured

func (r *PostgresRepository) IsConfigured() bool

func (*PostgresRepository) ListRuns

func (r *PostgresRepository) ListRuns(ctx context.Context, filter ListRunsFilter, limit, offset int64) ([]*m.TestRun, int64, error)

func (*PostgresRepository) RemoveRunsMarker

func (r *PostgresRepository) RemoveRunsMarker(ctx context.Context, runIDs []string) (int64, error)

func (*PostgresRepository) UpdateRunsMarker

func (r *PostgresRepository) UpdateRunsMarker(ctx context.Context, runIDs []string, marker string) (int64, error)

func (*PostgresRepository) UpsertRunShardStart

func (r *PostgresRepository) UpsertRunShardStart(ctx context.Context, shard *m.RunShard) error

UpsertRunShardStart upserts a run shard row derived from run-level shard metadata.

func (*PostgresRepository) UpsertRunStart

func (r *PostgresRepository) UpsertRunStart(ctx context.Context, run *m.TestRun) error

UpsertRunStart upserts a TestRun row from a mapped run start event. On conflict the mutable fields (name, status, metadata, timing) are updated.

func (*PostgresRepository) UpsertRunStartSuites

func (r *PostgresRepository) UpsertRunStartSuites(ctx context.Context, suites []*m.Suite) error

UpsertRunStartSuites upserts suite rows emitted in the run-start payload.

func (*PostgresRepository) UpsertRunStartTests

func (r *PostgresRepository) UpsertRunStartTests(ctx context.Context, tests []*m.Test) error

UpsertRunStartTests upserts test rows emitted in the run-start payload.

func (*PostgresRepository) UpsertTestBegin

func (r *PostgresRepository) UpsertTestBegin(ctx context.Context, test *m.Test, attempt *m.TestAttempt) error

UpsertTestBegin creates or updates the relational test row and its current attempt.

type TestTrendItem

type TestTrendItem struct {
	TestID    string     `json:"testId"`
	RunID     string     `json:"runId"`
	Status    string     `json:"status"`
	Duration  *int64     `json:"duration,omitempty"`
	StartTime *time.Time `json:"startTime,omitempty"`
	EndTime   *time.Time `json:"endTime,omitempty"`
	CreatedAt time.Time  `json:"createdAt"`
}

Jump to

Keyboard shortcuts

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