testutils

package
v0.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresPool

func NewPostgresPool(t *testing.T, ctx context.Context) *pgxpool.Pool

Types

type BaseSuite

type BaseSuite struct {
	suite.Suite

	PostgresPool *pgxpool.Pool

	// NATS
	NatsContainer *nats.NATSContainer
	NatsAddr      string
	NatsConn      *natsconn.NatsConnection

	// Services
	NatsCredsService *serverauth.NatsCredentialService
	ProjectsService  projects.ProjectsService

	// WebSocket
	LiveLogs *live.Logs
	// contains filtered or unexported fields
}

BaseSuite provides PostgreSQL and NATS for integration suites.

func (*BaseSuite) SetupSuite

func (s *BaseSuite) SetupSuite()

SetupSuite starts PostgreSQL and NATS containers.

func (*BaseSuite) TearDownSuite

func (s *BaseSuite) TearDownSuite()

TearDownSuite cleans up all containers

func (*BaseSuite) WithConfig

func (s *BaseSuite) WithConfig(config BaseSuiteConfig)

WithConfig sets custom configuration for the suite

type BaseSuiteConfig

type BaseSuiteConfig struct {
	ConfigPath      string
	NatsAccountSeed string
	NatsJwt         string
	NatsSeed        string
}

BaseSuiteConfig holds configuration for the base test suite

func DefaultBaseSuiteConfig

func DefaultBaseSuiteConfig() BaseSuiteConfig

DefaultBaseSuiteConfig returns sensible defaults

type NoopProjectService

type NoopProjectService struct{}

func (*NoopProjectService) ClientBelongsToProject

func (n *NoopProjectService) ClientBelongsToProject(ctx context.Context, projectID string, clientID string) (bool, error)

func (*NoopProjectService) CreateOrUpdateProject

func (n *NoopProjectService) CreateOrUpdateProject(ctx context.Context, project types.CreateProjectForm) (projects.Project, error)

CreateOrUpdateProject implements projects.ProjectsService.

func (*NoopProjectService) CreateProject

func (n *NoopProjectService) CreateProject(ctx context.Context, name string, clients []string) (projects.Project, error)

CreateProject implements projects.ProjectsService.

func (*NoopProjectService) DeleteProject

func (n *NoopProjectService) DeleteProject(ctx context.Context, id, confirmationName string) error

DeleteProject implements projects.ProjectsService.

func (*NoopProjectService) GetProject

func (n *NoopProjectService) GetProject(ctx context.Context, id string) (projects.Project, error)

GetProject implements projects.ProjectsService.

func (*NoopProjectService) GetProjectPage

GetProjectPage implements projects.ProjectsService.

func (*NoopProjectService) GetProjects

func (n *NoopProjectService) GetProjects(ctx context.Context) ([]projects.Project, error)

GetProjects implements projects.ProjectsService.

func (*NoopProjectService) GetProjectsByIds

func (n *NoopProjectService) GetProjectsByIds(ctx context.Context, ids []string) ([]projects.Project, error)

GetProjectsByIds implements projects.ProjectsService.

func (*NoopProjectService) ProjectExists

func (n *NoopProjectService) ProjectExists(ctx context.Context, projectId string, clientId string) bool

ProjectExists implements projects.ProjectsService.

func (*NoopProjectService) SearchProjects

SearchProjects implements projects.ProjectsService.

func (*NoopProjectService) UpdateProject

func (n *NoopProjectService) UpdateProject(ctx context.Context, id uuid.UUID, name string, clients []string) (projects.Project, error)

UpdateProject implements projects.ProjectsService.

Jump to

Keyboard shortcuts

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