testutil

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestImageName = "test-image-for-kubeflow-tf-operator:latest"
	TestTFJobName = "test-tfjob"
	LabelWorker   = "worker"
	LabelPS       = "ps"

	SleepInterval = 500 * time.Millisecond
	ThreadCount   = 1
)

Variables

View Source
var (
	AlwaysReady = func() bool { return true }
)
View Source
var (
	// KeyFunc is the short name to DeletionHandlingMetaNamespaceKeyFunc.
	// IndexerInformer uses a delta queue, therefore for deletes we have to use this
	// key function but it should be just fine for non delete events.
	KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc
)

Functions

func CheckCondition

func CheckCondition(tfJob *tfv1alpha2.TFJob, condition tfv1alpha2.TFJobConditionType, reason string) bool

func GetKey

func GetKey(tfJob *tfv1alpha2.TFJob, t *testing.T) string

func NewBasePod

func NewBasePod(name string, tfJob *tfv1alpha2.TFJob, t *testing.T) *v1.Pod

func NewBaseService

func NewBaseService(name string, tfJob *tfv1alpha2.TFJob, t *testing.T) *v1.Service

func NewPod

func NewPod(tfJob *tfv1alpha2.TFJob, typ string, index int, t *testing.T) *v1.Pod

func NewPodList

func NewPodList(count int32, status v1.PodPhase, tfJob *tfv1alpha2.TFJob, typ string, start int32, t *testing.T) []*v1.Pod

create count pods with the given phase for the given tfJob

func NewService

func NewService(tfJob *tfv1alpha2.TFJob, typ string, index int, t *testing.T) *v1.Service

func NewServiceList

func NewServiceList(count int32, tfJob *tfv1alpha2.TFJob, typ string, t *testing.T) []*v1.Service

NewServiceList creates count pods with the given phase for the given tfJob

func NewTFJob

func NewTFJob(worker, ps int) *tfv1alpha2.TFJob

func NewTFJobWithChief

func NewTFJobWithChief(worker, ps int) *tfv1alpha2.TFJob

func NewTFJobWithCleanPolicy

func NewTFJobWithCleanPolicy(chief, worker, ps int, policy tfv1alpha2.CleanPodPolicy) *tfv1alpha2.TFJob

func NewTFReplicaSpecTemplate

func NewTFReplicaSpecTemplate() v1.PodTemplateSpec

func SetPodsStatuses

func SetPodsStatuses(podIndexer cache.Indexer, tfJob *tfv1alpha2.TFJob, typ string, pendingPods, activePods, succeededPods, failedPods int32, t *testing.T)

func SetServices

func SetServices(serviceIndexer cache.Indexer, tfJob *tfv1alpha2.TFJob, typ string, activeWorkerServices int32, t *testing.T)

Types

This section is empty.

Jump to

Keyboard shortcuts

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