run

package
v0.0.0-...-3d8bab0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// APIVersion FIXME: not sure why this is needed
	APIVersion = "srossross.github.io/v1alpha1"

	// TestRunKind FIXME: not sure why this is needed
	TestRunKind = "TestRun"
)
View Source
var (
	// ReconsilePodStatus tells the Reconcile loop that a pod status has changed
	ReconsilePodStatus = "Pod"
	// ReconsileTestRun tells the Reconcile loop that a test run has changed
	ReconsileTestRun = "TestRun"
)
View Source
var TestRunCRD = &apiextensionsv1beta1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{
		Name: TestRunCRDName,
	},
	Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{
		Group:   Srossross.GroupName,
		Version: "v1alpha1",
		Scope:   apiextensionsv1beta1.NamespaceScoped,
		Names: apiextensionsv1beta1.CustomResourceDefinitionNames{
			Plural:     "testruns",
			Kind:       "TestRun",
			ShortNames: []string{"tr"},
		},
	},
}

TestRunCRD exposes the testrun as a crd

View Source
var TestRunCRDName = "testruns.srossross.github.io"

TestRunCRDName FIXME: could generate this ?

View Source
var TestTemplateCRD = &apiextensionsv1beta1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{
		Name: TestTemplateCRDName,
	},
	Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{
		Group:   Srossross.GroupName,
		Version: "v1alpha1",
		Scope:   apiextensionsv1beta1.NamespaceScoped,
		Names: apiextensionsv1beta1.CustomResourceDefinitionNames{
			Plural:     "testtemplates",
			Kind:       "TestTemplate",
			ShortNames: []string{"test", "tests"},
		},
	},
}

TestTemplateCRD exposes a test as a crd

View Source
var TestTemplateCRDName = "testtemplates.srossross.github.io"

TestTemplateCRDName FIXME: could generate this ?

Functions

func CreateTestPod

func CreateTestPod(ctrl controller.Interface, testRun *v1alpha1.TestRun, test *v1alpha1.TestTemplate) (*v1.Pod, error)

CreateTestPod creates a test pod from a test template

func CreateTestRunEvent

func CreateTestRunEvent(
	ctrl controller.Interface,
	testRun *v1alpha1.TestRun,
	testName string,
	Reason string,
	Message string,
) error

CreateTestRunEvent creates an event

func CreateTestRunEventStart

func CreateTestRunEventStart(ctrl controller.Interface, testRun *v1alpha1.TestRun, test *v1alpha1.TestTemplate) error

CreateTestRunEventStart will create a k8s event when a test pod is created

func InstallAllCRDs

func InstallAllCRDs(clientset apiextensionsclient.Interface) error

InstallAllCRDs and wait for them to be ready

func InstallCRD

InstallCRD and wait for it to be ready

func NewTestInformer

NewTestInformer creates a new test Informer that watches and caches tests

func NewTestRunInformer

func NewTestRunInformer(
	sharedFactory factory.SharedInformerFactory,
	queue workqueue.RateLimitingInterface,
) cache.SharedIndexInformer

NewTestRunInformer creates a new test run Informer that watches and caches testruns

func SetupPodInformer

SetupPodInformer creates a new test Informer that watches and caches pods

Types

type Interface

type Interface interface {
	PodStateChange(ctrl controller.Interface, testRun *v1alpha1.TestRun, pod *corev1.Pod) error
	UpdateTestRun(ctrl controller.Interface, testRun *v1alpha1.TestRun) error
}

Interface to be passed into work function

func New

func New() Interface

New creates a new runner

type ReconsileType

type ReconsileType string

ReconsileType is a string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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