Documentation ¶
Index ¶
- Constants
- type Helper
- func (h *Helper) CleanEtcdData(ctx context.Context) error
- func (h *Helper) GetIngressIP(ctx context.Context, namespace, name string) (string, error)
- func (h *Helper) GetPVCs(ctx context.Context, namespace, name string, ...) ([]corev1.PersistentVolumeClaim, error)
- func (h *Helper) GetPhase(ctx context.Context, namespace, name string, object client.Object) (greptimev1alpha1.Phase, error)
- func (h *Helper) KillPortForwardProcess()
- func (h *Helper) LoadCR(inputFile string, dstObject client.Object) error
- func (h *Helper) PortForward(ctx context.Context, namespace, svc string, srcPort int) (string, error)
- func (h *Helper) RunSQLTest(ctx context.Context, addr string, sqlFile string) error
- func (h *Helper) TimestampInMillisecond() int64
Constants ¶
const ( // MaxRetryTimesForAvailablePort is the maximum retry times to get an available random port for port forwarding. MaxRetryTimesForAvailablePort = 100 // MinPort is the minimum available port for port forwarding. MinPort = 10000 // MaxPort is the maximum available port for port forwarding. MaxPort = 30000 // DefaultTimeout is the default timeout for the e2e tests. DefaultTimeout = 1 * time.Minute // DefaultEtcdNamespace is the default namespace for the etcd cluster. DefaultEtcdNamespace = "etcd-cluster" // DefaultEtcdPodName is the default pod name for the etcd cluster. DefaultEtcdPodName = "etcd-0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Helper ¶
Helper is a helper utility for e2e tests.
func (*Helper) CleanEtcdData ¶
CleanEtcdData cleans up all data in etcd by executing the etcdctl command in the given pod.
func (*Helper) GetIngressIP ¶
GetIngressIP returns the ingress IP of the given service. It is assumed that the service is of type LoadBalancer.
func (*Helper) GetPVCs ¶
func (h *Helper) GetPVCs(ctx context.Context, namespace, name string, kind greptimev1alpha1.ComponentKind, fsType common.FileStorageType) ([]corev1.PersistentVolumeClaim, error)
GetPVCs returns the PVC list of the given component.
func (*Helper) GetPhase ¶
func (h *Helper) GetPhase(ctx context.Context, namespace, name string, object client.Object) (greptimev1alpha1.Phase, error)
GetPhase returns the phase of GreptimeDBCluster or GreptimeDBStandalone object.
func (*Helper) KillPortForwardProcess ¶
func (h *Helper) KillPortForwardProcess()
KillPortForwardProcess kills the port forwarding process.
func (*Helper) LoadCR ¶
LoadCR loads the CR from the input yaml file and unmarshals it into the given object.
func (*Helper) PortForward ¶
func (h *Helper) PortForward(ctx context.Context, namespace, svc string, srcPort int) (string, error)
PortForward uses kubectl to port forward the service to a local random available port.
func (*Helper) RunSQLTest ¶
RunSQLTest runs the SQL test of the given SQL file on the given address by using the pgx driver. TODO(zyy17): We need to use sqlness in the future.
func (*Helper) TimestampInMillisecond ¶
TimestampInMillisecond returns the current timestamp in milliseconds.