bdd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 55 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const AuthModeDBURLKey = "authModeDBURL"

AuthModeDBURLKey is the extra key for the shared database URL used by auth-mode scenario servers.

View Source
const OIDCTokenProviderExtraKey = "oidcTokenProvider"

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPrometheus

type MockPrometheus struct {
	Server *httptest.Server
	// contains filtered or unexported fields
}

MockPrometheus is a controllable mock Prometheus server for BDD tests.

func NewMockPrometheus

func NewMockPrometheus(t *testing.T) *MockPrometheus

NewMockPrometheus creates a mock Prometheus that returns canned time-series responses.

func (*MockPrometheus) SetAvailable

func (m *MockPrometheus) SetAvailable(value bool)

SetAvailable toggles whether mock Prometheus returns success or 503.

type MongoTestDB

type MongoTestDB struct {
	DBURL string
}

MongoTestDB implements cucumber.TestDB for MongoDB.

func (*MongoTestDB) ArchiveConversation

func (m *MongoTestDB) ArchiveConversation(ctx context.Context, conversationID string, days int) error

func (*MongoTestDB) ArchiveConversationOnly

func (m *MongoTestDB) ArchiveConversationOnly(ctx context.Context, conversationID string, days int) error

func (*MongoTestDB) ClaimReadyTasks

func (m *MongoTestDB) ClaimReadyTasks(ctx context.Context, limit int) ([]cucumber.TaskRow, error)

func (*MongoTestDB) ClearAll

func (m *MongoTestDB) ClearAll(ctx context.Context) error

func (*MongoTestDB) CountTasks

func (m *MongoTestDB) CountTasks(ctx context.Context) (int, error)

func (*MongoTestDB) CreateFailedTask

func (m *MongoTestDB) CreateFailedTask(ctx context.Context, id, taskType, body string) error

func (*MongoTestDB) CreateTask

func (m *MongoTestDB) CreateTask(ctx context.Context, id, taskType, body string) error

func (*MongoTestDB) DeleteAllTasks

func (m *MongoTestDB) DeleteAllTasks(ctx context.Context) error

func (*MongoTestDB) DeleteTask

func (m *MongoTestDB) DeleteTask(ctx context.Context, id string) error

func (*MongoTestDB) ExecMongoQuery

func (m *MongoTestDB) ExecMongoQuery(ctx context.Context, query string) ([]map[string]interface{}, error)

func (*MongoTestDB) ExecSQL

func (m *MongoTestDB) ExecSQL(_ context.Context, _ string) ([]map[string]interface{}, error)

func (*MongoTestDB) FailTask

func (m *MongoTestDB) FailTask(ctx context.Context, id, errMsg string) error

func (*MongoTestDB) GetTask

func (m *MongoTestDB) GetTask(ctx context.Context, id string) (*cucumber.TaskRow, error)

func (*MongoTestDB) InterruptAppendBatch added in v0.4.0

func (m *MongoTestDB) InterruptAppendBatch(ctx context.Context, anchorID string) error

InterruptAppendBatch leaves only the durable sequence anchor, as after a crash.

func (*MongoTestDB) ResolveGroupID

func (m *MongoTestDB) ResolveGroupID(ctx context.Context, conversationID string) (string, error)

func (*MongoTestDB) SetConversationEntriesCreatedAt added in v0.0.4

func (m *MongoTestDB) SetConversationEntriesCreatedAt(ctx context.Context, conversationID string, createdAt time.Time) error

func (*MongoTestDB) SetConversationTimestamps added in v0.2.3

func (m *MongoTestDB) SetConversationTimestamps(ctx context.Context, conversationID string, createdAt, updatedAt time.Time) error

func (*MongoTestDB) SetEntryCreatedAt added in v0.2.2

func (m *MongoTestDB) SetEntryCreatedAt(ctx context.Context, entryID string, createdAt time.Time) error

type PostgresTestDB

type PostgresTestDB struct {
	DBURL string
}

PostgresTestDB implements cucumber.TestDB for Postgres.

func (*PostgresTestDB) ArchiveConversation

func (p *PostgresTestDB) ArchiveConversation(ctx context.Context, conversationID string, days int) error

func (*PostgresTestDB) ArchiveConversationOnly

func (p *PostgresTestDB) ArchiveConversationOnly(ctx context.Context, conversationID string, days int) error

func (*PostgresTestDB) ClaimReadyTasks

func (p *PostgresTestDB) ClaimReadyTasks(ctx context.Context, limit int) ([]cucumber.TaskRow, error)

func (*PostgresTestDB) ClearAll

func (p *PostgresTestDB) ClearAll(ctx context.Context) error

func (*PostgresTestDB) CountTasks

func (p *PostgresTestDB) CountTasks(ctx context.Context) (int, error)

func (*PostgresTestDB) CreateFailedTask

func (p *PostgresTestDB) CreateFailedTask(ctx context.Context, id, taskType, body string) error

func (*PostgresTestDB) CreateTask

func (p *PostgresTestDB) CreateTask(ctx context.Context, id, taskType, body string) error

Task helpers use Go-side UTC timestamps for created_at/retry_at and comparisons. Mixing database NOW() with Go-side assertions is flaky under container clock skew.

func (*PostgresTestDB) DeleteAllTasks

func (p *PostgresTestDB) DeleteAllTasks(ctx context.Context) error

func (*PostgresTestDB) DeleteTask

func (p *PostgresTestDB) DeleteTask(ctx context.Context, id string) error

func (*PostgresTestDB) ExecMongoQuery

func (p *PostgresTestDB) ExecMongoQuery(_ context.Context, _ string) ([]map[string]interface{}, error)

func (*PostgresTestDB) ExecSQL

func (p *PostgresTestDB) ExecSQL(ctx context.Context, query string) ([]map[string]interface{}, error)

func (*PostgresTestDB) FailTask

func (p *PostgresTestDB) FailTask(ctx context.Context, id, errMsg string) error

func (*PostgresTestDB) GetTask

func (p *PostgresTestDB) GetTask(ctx context.Context, id string) (*cucumber.TaskRow, error)

func (*PostgresTestDB) ResolveGroupID

func (p *PostgresTestDB) ResolveGroupID(ctx context.Context, conversationID string) (string, error)

func (*PostgresTestDB) SetConversationEntriesCreatedAt added in v0.0.4

func (p *PostgresTestDB) SetConversationEntriesCreatedAt(ctx context.Context, conversationID string, createdAt time.Time) error

func (*PostgresTestDB) SetConversationTimestamps added in v0.2.3

func (p *PostgresTestDB) SetConversationTimestamps(ctx context.Context, conversationID string, createdAt, updatedAt time.Time) error

func (*PostgresTestDB) SetEntryCreatedAt added in v0.2.2

func (p *PostgresTestDB) SetEntryCreatedAt(ctx context.Context, entryID string, createdAt time.Time) error

type SQLiteTestDB

type SQLiteTestDB struct {
	DBURL string
	// contains filtered or unexported fields
}

SQLiteTestDB implements cucumber.TestDB for SQLite.

func (*SQLiteTestDB) ArchiveConversation

func (s *SQLiteTestDB) ArchiveConversation(ctx context.Context, conversationID string, days int) error

func (*SQLiteTestDB) ArchiveConversationOnly

func (s *SQLiteTestDB) ArchiveConversationOnly(ctx context.Context, conversationID string, days int) error

func (*SQLiteTestDB) ClaimReadyTasks

func (s *SQLiteTestDB) ClaimReadyTasks(ctx context.Context, limit int) ([]cucumber.TaskRow, error)

func (*SQLiteTestDB) ClearAll

func (s *SQLiteTestDB) ClearAll(ctx context.Context) error

func (*SQLiteTestDB) CountTasks

func (s *SQLiteTestDB) CountTasks(ctx context.Context) (int, error)

func (*SQLiteTestDB) CreateFailedTask

func (s *SQLiteTestDB) CreateFailedTask(ctx context.Context, id, taskType, body string) error

func (*SQLiteTestDB) CreateTask

func (s *SQLiteTestDB) CreateTask(ctx context.Context, id, taskType, body string) error

func (*SQLiteTestDB) DeleteAllTasks

func (s *SQLiteTestDB) DeleteAllTasks(ctx context.Context) error

func (*SQLiteTestDB) DeleteTask

func (s *SQLiteTestDB) DeleteTask(ctx context.Context, id string) error

func (*SQLiteTestDB) ExecMongoQuery

func (s *SQLiteTestDB) ExecMongoQuery(_ context.Context, _ string) ([]map[string]interface{}, error)

func (*SQLiteTestDB) ExecSQL

func (s *SQLiteTestDB) ExecSQL(ctx context.Context, query string) ([]map[string]interface{}, error)

func (*SQLiteTestDB) FailTask

func (s *SQLiteTestDB) FailTask(ctx context.Context, id, errMsg string) error

func (*SQLiteTestDB) GetTask

func (s *SQLiteTestDB) GetTask(ctx context.Context, id string) (*cucumber.TaskRow, error)

func (*SQLiteTestDB) ResolveGroupID

func (s *SQLiteTestDB) ResolveGroupID(ctx context.Context, conversationID string) (string, error)

func (*SQLiteTestDB) SetConversationEntriesCreatedAt added in v0.0.4

func (s *SQLiteTestDB) SetConversationEntriesCreatedAt(ctx context.Context, conversationID string, createdAt time.Time) error

func (*SQLiteTestDB) SetConversationTimestamps added in v0.2.3

func (s *SQLiteTestDB) SetConversationTimestamps(ctx context.Context, conversationID string, createdAt, updatedAt time.Time) error

func (*SQLiteTestDB) SetEntryCreatedAt added in v0.2.2

func (s *SQLiteTestDB) SetEntryCreatedAt(ctx context.Context, entryID string, createdAt time.Time) error

Jump to

Keyboard shortcuts

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