cukes

package
v0.0.0-...-ea90ac2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-3-Clause-Clear Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const StatelessTag = "@stateless"

Variables

This section is empty.

Functions

func ConvertInterfaceToAny

func ConvertInterfaceToAny(jsonData []byte) (*anypb.Any, error)

func GetActionsFromValues

func GetActionsFromValues(standardActions *string, customActions *string) []*policy.Action

func GetProjectDir

func GetProjectDir() (string, error)

func LogComposeService

func LogComposeService(ctx context.Context, container *tcb.DockerContainer, logger *slog.Logger, svc string)

LogComposeService logs to `logger` all log statements for a docker container

func LogComposeServices

func LogComposeServices(c interface{}, logger *slog.Logger)

LogComposeServices logs to `logger` all log statements for each service within the DockerStack instance 'c'

func NewPlatformCukesContext

func NewPlatformCukesContext(cukesContext PlatformTestSuiteContext) context.Context

NewPlatformCukesContext creates a context with a PlatformTestSuiteContext struct value using the contextKey

func RegisterAttributeStepDefinitions

func RegisterAttributeStepDefinitions(ctx *godog.ScenarioContext, x *PlatformTestSuiteContext)

func RegisterAuthorizationStepDefinitions

func RegisterAuthorizationStepDefinitions(ctx *godog.ScenarioContext)

func RegisterLocalPlatformStepDefinitions

func RegisterLocalPlatformStepDefinitions(ctx *godog.ScenarioContext, x *PlatformTestSuiteContext)

func RegisterNamespaceStepDefinitions

func RegisterNamespaceStepDefinitions(ctx *godog.ScenarioContext)

func RegisterObligationsStepDefinitions

func RegisterObligationsStepDefinitions(ctx *godog.ScenarioContext, _ *PlatformTestSuiteContext)

func RegisterSmokeStepDefinitions

func RegisterSmokeStepDefinitions(ctx *godog.ScenarioContext, x *PlatformTestSuiteContext)

func RegisterSubjectMappingsStepsDefinitions

func RegisterSubjectMappingsStepsDefinitions(ctx *godog.ScenarioContext)

Types

type AttributesStepDefinitions

type AttributesStepDefinitions struct {
	PlatformCukesContext *PlatformTestSuiteContext
}

type AuthorizationServiceStepDefinitions

type AuthorizationServiceStepDefinitions struct{}

type DockerComposeLogger

type DockerComposeLogger struct {
	Logger *slog.Logger
}

func (*DockerComposeLogger) Printf

func (d *DockerComposeLogger) Printf(format string, v ...interface{})

type LocalDevOptions

type LocalDevOptions struct {
	Hostname   string
	CukesDir   string // temp directory for cukes test suite
	KeysDir    string // directory with opentdf keys
	ProjectDir string // the opentdf project directory.
	// contains filtered or unexported fields
}

func NewLocalDevOptions

func NewLocalDevOptions() (LocalDevOptions, error)

type LocalDevPlatformGlue

type LocalDevPlatformGlue struct {
	Options *LocalDevOptions
	Context context.Context //nolint:containedctx // cukes test scenario context
}

func NewLocalDevPlatformGlue

func NewLocalDevPlatformGlue(options LocalDevOptions) *LocalDevPlatformGlue

func (*LocalDevPlatformGlue) Setup

func (l *LocalDevPlatformGlue) Setup(platformCukesContext *PlatformTestSuiteContext) error

Setup local platform including cert/key generation and platform and keycloak configuration setup.

func (*LocalDevPlatformGlue) Shutdown

func (l *LocalDevPlatformGlue) Shutdown(platformCukesContext *PlatformTestSuiteContext) error

type LocalDevScenarioOptions

type LocalDevScenarioOptions struct {
	PlatformEndpoint       string
	KeycloakRealm          string
	InsecureSkipVerifyConn bool
	DatabaseName           string
	PlatformPort           int
}

type LocalPlatformStepDefinitions

type LocalPlatformStepDefinitions struct {
	PlatformCukesContext *PlatformTestSuiteContext
}

type NamespacesStepDefinitions

type NamespacesStepDefinitions struct{}

type ObligationsStepDefinitions

type ObligationsStepDefinitions struct{}

type PlatformCukesHelper

type PlatformCukesHelper interface {
	*context.Context
}

type PlatformGlue

type PlatformGlue interface {
	Setup(*PlatformTestSuiteContext) error
	Shutdown(*PlatformTestSuiteContext) error
}

type PlatformScenarioContext

type PlatformScenarioContext struct {
	SDK              *otdf.SDK
	ID               string
	ScenarioOptions  *LocalDevScenarioOptions
	TestSuiteContext *PlatformTestSuiteContext
	FirstScenario    bool
	Stateless        bool
	Scenario         *godog.Scenario

	ShutdownHooks []func() error
	// contains filtered or unexported fields
}

func GetPlatformScenarioContext

func GetPlatformScenarioContext(ctx context.Context) *PlatformScenarioContext

func (*PlatformScenarioContext) ClearError

func (c *PlatformScenarioContext) ClearError()

func (*PlatformScenarioContext) GetAttributeValue

func (c *PlatformScenarioContext) GetAttributeValue(ctx context.Context, fqn string) (*policy.Value, error)

func (*PlatformScenarioContext) GetError

func (c *PlatformScenarioContext) GetError() error

func (*PlatformScenarioContext) GetObject

func (c *PlatformScenarioContext) GetObject(key string) any

func (*PlatformScenarioContext) RecordObject

func (c *PlatformScenarioContext) RecordObject(key string, obj any)

func (*PlatformScenarioContext) RegisterShutdownHook

func (c *PlatformScenarioContext) RegisterShutdownHook(hook func() error)

func (*PlatformScenarioContext) SetError

func (c *PlatformScenarioContext) SetError(err error)

type PlatformTestSuiteContext

type PlatformTestSuiteContext struct {
	PlatformGlue      *PlatformGlue
	ShutdownFunctions []func() error
	FeatureTracker    map[string]*PlatformScenarioContext
	Logger            *slog.Logger
	ComposeLogger     *slog.Logger
	HasFailures       bool // Track if any test failures occurred
}

func CreatePlatformCukesContext

func CreatePlatformCukesContext(logger *slog.Logger, composeLogger *slog.Logger) *PlatformTestSuiteContext

func (*PlatformTestSuiteContext) InitializeScenario

func (c *PlatformTestSuiteContext) InitializeScenario(scenarioContext *godog.ScenarioContext)

func (*PlatformTestSuiteContext) InitializeTestSuite

func (c *PlatformTestSuiteContext) InitializeTestSuite(ctx *godog.TestSuiteContext)

func (*PlatformTestSuiteContext) RecordFailure

func (c *PlatformTestSuiteContext) RecordFailure()

type SmokeStepDefinitions

type SmokeStepDefinitions struct {
	PlatformCukesContext *PlatformTestSuiteContext
}

type SubjectMappingsStepDefinitions

type SubjectMappingsStepDefinitions struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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