framework

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncWaitPodsRollingUpdateOnce

func AsyncWaitPodsRollingUpdateOnce[
	S scope.Group[F, T],
	F client.Object,
	T runtime.Group,
](ctx context.Context, f *Framework, obj F, to int) chan struct{}

func MustEvenlySpread

func MustEvenlySpread[
	GS scope.GroupInstance[GF, GT, IS],
	IS scope.InstanceList[IF, IT, IL],
	GF client.Object,
	GT runtime.Group,
	IF client.Object,
	IT runtime.Instance,
	IL client.ObjectList,
](ctx context.Context, f *Framework, g GF)

func NewConfig

func NewConfig(configPath, ctxName string) (*rest.Config, error)

func WaitForGroupSynced

func WaitForGroupSynced[
	S scope.Group[F, T],
	F client.Object,
	T runtime.Group,
](
	ctx context.Context,
	f *Framework,
	g F,
)

func WaitForInstanceListSynced

func WaitForInstanceListSynced[
	GS scope.GroupInstance[GF, GT, IS],
	IS scope.InstanceList[IF, IT, IL],
	GF client.Object,
	GT runtime.Group,
	IF client.Object,
	IT runtime.Instance,
	IL client.ObjectList,
](
	ctx context.Context,
	f *Framework,
	g GF,
)

WaitForInstanceListSynced waits until all instances being created and all subresources of instances being created. It's usefull to wait until all unschedulable pods being created.

Types

type CertManager

type CertManager struct {
	// contains filtered or unexported fields
}

func (*CertManager) Install

func (cm *CertManager) Install(ctx context.Context, ns, cluster string)

Install is called to install all certs of the whole cluster NOTE: Install must be called after all groups have been created

type Framework

type Framework struct {
	Namespace *corev1.Namespace
	Cluster   *v1alpha1.Cluster

	Client client.Client
	// contains filtered or unexported fields
}

func New

func New() *Framework

func (*Framework) DescribeFeatureTable

func (*Framework) DescribeFeatureTable(f func(fs ...metav1alpha1.Feature), fss ...[]metav1alpha1.Feature)

DescribeFeatureTable generates a case with different features

func (*Framework) Must

func (*Framework) Must(err error)

func (*Framework) MustCreateCluster

func (f *Framework) MustCreateCluster(ctx context.Context, ps ...data.ClusterPatch) *v1alpha1.Cluster

func (*Framework) MustCreatePD

func (f *Framework) MustCreatePD(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.PDGroup]) *v1alpha1.PDGroup

func (*Framework) MustCreateS3

func (f *Framework) MustCreateS3(ctx context.Context)

func (*Framework) MustCreateScheduling

func (f *Framework) MustCreateScheduling(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.SchedulingGroup]) *v1alpha1.SchedulingGroup

func (*Framework) MustCreateTSO

func (f *Framework) MustCreateTSO(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.TSOGroup]) *v1alpha1.TSOGroup

func (*Framework) MustCreateTiCDC

func (f *Framework) MustCreateTiCDC(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.TiCDCGroup]) *v1alpha1.TiCDCGroup

func (*Framework) MustCreateTiDB

func (f *Framework) MustCreateTiDB(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.TiDBGroup]) *v1alpha1.TiDBGroup

func (*Framework) MustCreateTiFlash

func (f *Framework) MustCreateTiFlash(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.TiFlashGroup]) *v1alpha1.TiFlashGroup

func (*Framework) MustCreateTiKV

func (f *Framework) MustCreateTiKV(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.TiKVGroup]) *v1alpha1.TiKVGroup

func (*Framework) MustCreateTiProxy

func (f *Framework) MustCreateTiProxy(ctx context.Context, ps ...data.GroupPatch[*v1alpha1.TiProxyGroup]) *v1alpha1.TiProxyGroup

func (*Framework) PortForwardPod

func (f *Framework) PortForwardPod(ctx context.Context, pod *corev1.Pod, ports []string) []portforward.ForwardedPort

func (*Framework) RestartTiCDCPod

func (f *Framework) RestartTiCDCPod(ctx context.Context, cdc *v1alpha1.TiCDC)

func (*Framework) RestartTiKVPod

func (f *Framework) RestartTiKVPod(ctx context.Context, kv *v1alpha1.TiKV)

func (*Framework) Setup

func (f *Framework) Setup(opts ...SetupOption)

func (*Framework) SetupBootstrapSQL

func (f *Framework) SetupBootstrapSQL(sql string)

func (*Framework) SetupCertManager

func (f *Framework) SetupCertManager() *CertManager

func (*Framework) SetupCluster

func (f *Framework) SetupCluster(ps ...data.ClusterPatch)

func (*Framework) SetupWorkload

func (f *Framework) SetupWorkload() *Workload

func (*Framework) True

func (*Framework) True(b bool, opts ...any)

func (*Framework) WaitForAllReady

func (f *Framework) WaitForAllReady(ctx context.Context, cn string)

func (*Framework) WaitForPDGroupReady

func (f *Framework) WaitForPDGroupReady(ctx context.Context, pdg *v1alpha1.PDGroup)

func (*Framework) WaitForPDGroupReadyAndNotSuspended

func (f *Framework) WaitForPDGroupReadyAndNotSuspended(ctx context.Context, pdg *v1alpha1.PDGroup)

func (*Framework) WaitForPDGroupSuspended

func (f *Framework) WaitForPDGroupSuspended(ctx context.Context, pdg *v1alpha1.PDGroup)

func (*Framework) WaitForSchedulingGroupReady

func (f *Framework) WaitForSchedulingGroupReady(ctx context.Context, sg *v1alpha1.SchedulingGroup)

func (*Framework) WaitForTSOGroupReady

func (f *Framework) WaitForTSOGroupReady(ctx context.Context, tg *v1alpha1.TSOGroup)

func (*Framework) WaitForTiCDCGroupReady

func (f *Framework) WaitForTiCDCGroupReady(ctx context.Context, cg *v1alpha1.TiCDCGroup)

func (*Framework) WaitForTiDBGroupReady

func (f *Framework) WaitForTiDBGroupReady(ctx context.Context, dbg *v1alpha1.TiDBGroup)

func (*Framework) WaitForTiFlashGroupReady

func (f *Framework) WaitForTiFlashGroupReady(ctx context.Context, fg *v1alpha1.TiFlashGroup)

func (*Framework) WaitForTiKVGroupReady

func (f *Framework) WaitForTiKVGroupReady(ctx context.Context, kvg *v1alpha1.TiKVGroup)

func (*Framework) WaitForTiProxyGroupReady

func (f *Framework) WaitForTiProxyGroupReady(ctx context.Context, pg *v1alpha1.TiProxyGroup)

func (*Framework) WaitTiCDCPreStopHookSuccess

func (f *Framework) WaitTiCDCPreStopHookSuccess(ctx context.Context, cdc *v1alpha1.TiCDC)

func (*Framework) WaitTiKVPreStopHookSuccess

func (f *Framework) WaitTiKVPreStopHookSuccess(ctx context.Context, kv *v1alpha1.TiKV)

type SetupOption

type SetupOption func(opts *SetupOptions)

func WithSkipClusterCreation

func WithSkipClusterCreation() SetupOption

func WithSkipClusterDeletionWhenFailed

func WithSkipClusterDeletionWhenFailed() SetupOption

func WithSkipWaitForClusterDeleted

func WithSkipWaitForClusterDeleted() SetupOption

func WithSkipWaitForNamespaceDeleted

func WithSkipWaitForNamespaceDeleted() SetupOption

type SetupOptions

type SetupOptions struct {
	SkipWaitForClusterDeleted    bool
	SkipWaitForNamespaceDeleted  bool
	SkipClusterCreation          bool
	SkipClusterDeletedWhenFailed bool
}

type Workload

type Workload struct {
	// contains filtered or unexported fields
}

func (*Workload) DeferPrintLogs

func (w *Workload) DeferPrintLogs()

func (*Workload) MustImportData

func (w *Workload) MustImportData(ctx context.Context, host string, opts ...workload.Option)

func (*Workload) MustPing

func (w *Workload) MustPing(ctx context.Context, host string, opts ...workload.Option)

func (*Workload) MustRunPDRegionAccess

func (w *Workload) MustRunPDRegionAccess(ctx context.Context, pdEndpoints string, opts ...workload.Option) (done chan struct{})

func (*Workload) MustRunWorkload

func (w *Workload) MustRunWorkload(ctx context.Context, host string, opts ...workload.Option) (done chan struct{})

func (*Workload) StopJob

func (w *Workload) StopJob(ctx context.Context, job *batchv1.Job) context.Context

StopJob stops the job if ctx is cancelled If stop failed, the returned ctx will be cancelled

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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