integrationutils

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cmkd   Service = "/bin/cmkd"
	Cmkctl Service = "/bin/cmkctl"

	APIServer      Command = "api-server"
	TenantManager  Command = "tenant-manager"
	EventProcessor Command = "event-processor"
	TaskWorker     Command = "task-woker"
	TaskScheduler  Command = "task-scheduler"
	DBMigrator     Command = "db-migrator"

	TaskCLI Command = "task"
)

Variables

View Source
var DB = config.Database{
	Host: commoncfg.SourceRef{
		Source: commoncfg.EmbeddedSourceValue,
		Value:  "localhost",
	},
	User: commoncfg.SourceRef{
		Source: commoncfg.EmbeddedSourceValue,
		Value:  "admin",
	},
	Secret: commoncfg.SourceRef{
		Source: commoncfg.EmbeddedSourceValue,
		Value:  "password",
	},
	Name: "mydb",
	Port: "5432",
}
View Source
var MessageService = config.Redis{
	Host: commoncfg.SourceRef{
		Source: commoncfg.EmbeddedSourceValue,
		Value:  "localhost",
	},
	ACL: config.RedisACL{
		Enabled: true,
		Password: commoncfg.SourceRef{
			Source: commoncfg.EmbeddedSourceValue,
			Value:  "secret",
		},
		Username: commoncfg.SourceRef{
			Source: commoncfg.EmbeddedSourceValue,
			Value:  "default",
		},
	},
	Port: "6379",
	SecretRef: commoncfg.SecretRef{
		Type: commoncfg.InsecureSecretType,
	},
}

Functions

func BuildCMKImage added in v0.9.0

func BuildCMKImage(t *testing.T) string

BuildCMKImage runs makefile step docker-dev-build to build the image This is only needed as there is a bug with testcontainers and docker buildkit

func GroupsExists

func GroupsExists(ctx context.Context, t require.TestingT, tenantID string, multitenancydb *multitenancy.DB)

func MissingFiles

func MissingFiles(t *testing.T, requiredFiles []string) bool

func NamespaceExists

func NamespaceExists(database *multitenancy.DB, tenantName string) (bool, error)

func RegisterNoopPlugins added in v0.9.0

func RegisterNoopPlugins(registry catalog.BuiltInPluginRegistry)

func RunCMKService added in v0.9.0

func RunCMKService(t *testing.T, svcCfg ServiceConfig, cfg *config.Config) testcontainers.Container

RunCMKService builds image and starts a testcontainer with the provided service This might take some time if there isn't an image built, but it has caching mechanisms Returns the container so you can execute commands or interact with it

func TableInTenantSchemaExist

func TableInTenantSchemaExist(database *multitenancy.DB, tenantName string,
	tableName string,
) (bool, error)

func TenantExists

func TenantExists(t require.TestingT, multitenancydb *multitenancy.DB, schemaName, tableName string)

func TenantExistsInPublicSchema

func TenantExistsInPublicSchema(database *multitenancy.DB, tenantName string) (bool, error)

func TenantSchemaExists

func TenantSchemaExists(database *multitenancy.DB, tenantName string) (bool, error)

Types

type Command added in v0.10.0

type Command string

type Service added in v0.9.0

type Service string

type ServiceConfig added in v0.9.0

type ServiceConfig struct {
	Service Service
	Name    string
	Args    []string
}

type TableInfo

type TableInfo struct {
	Schema string `gorm:"column:table_schema"`
	Name   string `gorm:"column:table_name"`
}

func (TableInfo) TableName

func (TableInfo) TableName() string

Jump to

Keyboard shortcuts

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