bdd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

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) ResolveGroupID

func (m *MongoTestDB) ResolveGroupID(ctx context.Context, conversationID string) (string, 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

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)

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)

Jump to

Keyboard shortcuts

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