integration

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout  = 10 * time.Second
	DefaultInterval = 100 * time.Millisecond
)

Variables

View Source
var DefaultValidContext = v1beta1.Context{
	TypeMeta: metav1.TypeMeta{
		Kind:       "Context",
		APIVersion: v1beta1.GroupVersion.String(),
	},
	ObjectMeta: metav1.ObjectMeta{
		Name:      "test-context",
		Namespace: "default",
	},
	Spec: v1beta1.ContextSpec{
		SpaceId: utils.AddressOf("test-space-id"),
	},
}
View Source
var DefaultValidPolicy = v1beta1.Policy{
	TypeMeta: metav1.TypeMeta{
		Kind:       "Policy",
		APIVersion: v1beta1.GroupVersion.String(),
	},
	ObjectMeta: metav1.ObjectMeta{
		GenerateName: "test-policy",
		Namespace:    "default",
	},
	Spec: v1beta1.PolicySpec{
		Body: "package spacelift",
		Type: "PLAN",
	},
}
View Source
var DefaultValidRun = v1beta1.Run{
	TypeMeta: metav1.TypeMeta{
		Kind:       "Run",
		APIVersion: v1beta1.GroupVersion.String(),
	},
	ObjectMeta: metav1.ObjectMeta{
		GenerateName: "test-run",
		Namespace:    "default",
	},
	Spec: v1beta1.RunSpec{
		StackName: "test-stack",
	},
}
View Source
var DefaultValidStack = v1beta1.Stack{
	TypeMeta: metav1.TypeMeta{
		Kind:       "Stack",
		APIVersion: v1beta1.GroupVersion.String(),
	},
	ObjectMeta: metav1.ObjectMeta{
		Name:      "test-stack",
		Namespace: "default",
	},
	Spec: v1beta1.StackSpec{
		Branch:     utils.AddressOf("fake-branch"),
		Repository: "fake-repository",
		SpaceId:    utils.AddressOf("fake-space"),
	},
}
View Source
var DefaultValidStackStatus = v1beta1.StackStatus{
	Id: "test-stack-id",
}

Functions

This section is empty.

Types

type AllLogLevelEnabler

type AllLogLevelEnabler struct{}

AllLogLevelEnabler is a simple log level enabled that allows to grap logs from all kind of levels

func (AllLogLevelEnabler) Enabled

func (a AllLogLevelEnabler) Enabled(zapcore.Level) bool

type IntegrationTestSuite

type IntegrationTestSuite struct {
	suite.Suite

	SetupManager func(manager.Manager)

	Logs *observer.ObservedLogs

	FakeSpaceliftRunRepo     *mocks.RunRepository
	FakeSpaceliftStackRepo   *mocks.StackRepository
	FakeSpaceliftSpaceRepo   *mocks.SpaceRepository
	FakeSpaceliftContextRepo *mocks.ContextRepository
	FakeSpaceliftPolicyRepo  *mocks.PolicyRepository

	RunRepo     *repository.RunRepository
	StackRepo   *repository.StackRepository
	SpaceRepo   *repository.SpaceRepository
	ContextRepo *repository.ContextRepository
	SecretRepo  *repository.SecretRepository
	PolicyRepo  *repository.PolicyRepository
	// contains filtered or unexported fields
}

func (*IntegrationTestSuite) Client

func (s *IntegrationTestSuite) Client() client.Client

func (*IntegrationTestSuite) Context

func (s *IntegrationTestSuite) Context() context.Context

func (*IntegrationTestSuite) SetupSuite

func (s *IntegrationTestSuite) SetupSuite()

func (*IntegrationTestSuite) SetupTest

func (s *IntegrationTestSuite) SetupTest()

func (*IntegrationTestSuite) TearDownSuite

func (s *IntegrationTestSuite) TearDownSuite()

type WithContextSuiteHelper

type WithContextSuiteHelper struct {
	*IntegrationTestSuite
}

func (*WithContextSuiteHelper) CreateContext

func (s *WithContextSuiteHelper) CreateContext(context *v1beta1.Context) error

func (*WithContextSuiteHelper) CreateTestContext

func (s *WithContextSuiteHelper) CreateTestContext() (*v1beta1.Context, error)

func (*WithContextSuiteHelper) DeleteContext

func (s *WithContextSuiteHelper) DeleteContext(context *v1beta1.Context)

func (*WithContextSuiteHelper) WaitUntilContextExists

func (s *WithContextSuiteHelper) WaitUntilContextExists(context *v1beta1.Context) bool

func (*WithContextSuiteHelper) WaitUntilContextRemoved

func (s *WithContextSuiteHelper) WaitUntilContextRemoved(context *v1beta1.Context) bool

type WithEventHelper

type WithEventHelper struct {
	*IntegrationTestSuite
}

func (*WithEventHelper) FindEvents

func (s *WithEventHelper) FindEvents(object types.NamespacedName, reason string) ([]v1.Event, error)

type WithPolicySuiteHelper

type WithPolicySuiteHelper struct {
	*IntegrationTestSuite
}

func (*WithPolicySuiteHelper) CreatePolicy

func (s *WithPolicySuiteHelper) CreatePolicy(policy *v1beta1.Policy) error

func (*WithPolicySuiteHelper) CreateTestPolicy

func (s *WithPolicySuiteHelper) CreateTestPolicy() (*v1beta1.Policy, error)

func (*WithPolicySuiteHelper) DeletePolicy

func (s *WithPolicySuiteHelper) DeletePolicy(policy *v1beta1.Policy) error

type WithRunSuiteHelper

type WithRunSuiteHelper struct {
	*IntegrationTestSuite
}

func (*WithRunSuiteHelper) AssertRunState

func (s *WithRunSuiteHelper) AssertRunState(run *v1beta1.Run, status v1beta1.RunState, timeParams ...time.Duration) *v1beta1.Run

func (*WithRunSuiteHelper) CreateRun

func (s *WithRunSuiteHelper) CreateRun(run *v1beta1.Run) error

func (*WithRunSuiteHelper) CreateTestRun

func (s *WithRunSuiteHelper) CreateTestRun() (*v1beta1.Run, error)

type WithSpaceSuiteHelper

type WithSpaceSuiteHelper struct {
	*IntegrationTestSuite
}

func (*WithSpaceSuiteHelper) CreateSpace

func (s *WithSpaceSuiteHelper) CreateSpace(space *v1beta1.Space) (*v1beta1.Space, error)

func (*WithSpaceSuiteHelper) CreateTestSpace

func (s *WithSpaceSuiteHelper) CreateTestSpace() (*v1beta1.Space, error)

func (*WithSpaceSuiteHelper) CreateTestSpaceWithStatus

func (s *WithSpaceSuiteHelper) CreateTestSpaceWithStatus() (*v1beta1.Space, error)

func (*WithSpaceSuiteHelper) DeleteSpace

func (s *WithSpaceSuiteHelper) DeleteSpace(space *v1beta1.Space)

func (*WithSpaceSuiteHelper) WaitUntilSpaceRemoved

func (s *WithSpaceSuiteHelper) WaitUntilSpaceRemoved(space *v1beta1.Space)

type WithStackSuiteHelper

type WithStackSuiteHelper struct {
	*IntegrationTestSuite
}

func (*WithStackSuiteHelper) CreateStack

func (s *WithStackSuiteHelper) CreateStack(stack *v1beta1.Stack) (*v1beta1.Stack, error)

func (*WithStackSuiteHelper) CreateTestStack

func (s *WithStackSuiteHelper) CreateTestStack() (*v1beta1.Stack, error)

func (*WithStackSuiteHelper) CreateTestStackWithStatus

func (s *WithStackSuiteHelper) CreateTestStackWithStatus() (*v1beta1.Stack, error)

func (*WithStackSuiteHelper) DeleteStack

func (s *WithStackSuiteHelper) DeleteStack(stack *v1beta1.Stack)

func (*WithStackSuiteHelper) GetStackOutput

func (s *WithStackSuiteHelper) GetStackOutput(stack *v1beta1.Stack) (*v1.Secret, error)

func (*WithStackSuiteHelper) WaitUntilStackExists

func (s *WithStackSuiteHelper) WaitUntilStackExists(stack *v1beta1.Stack) bool

func (*WithStackSuiteHelper) WaitUntilStackRemoved

func (s *WithStackSuiteHelper) WaitUntilStackRemoved(stack *v1beta1.Stack) bool

Jump to

Keyboard shortcuts

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