integration_tests

package
v0.0.0-...-4634687 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

README

How to run Integration Tests

  • For development (controller will reconsile internally)

    • As a part of the whole testing suite just:

    make test

    • Standalone, just integration tests:

    make integration-test

  • For QE (integration/e2e testing). No OLM There are 2 environment variables to use with make command

    • USE_EXISTING_CLUSTER=true tells test suite to use externally running cluster (from the current .kube/config context) instead of envtest.
    • USE_EXISTING_CONTROLLER=true tells test suite to use operator controller manager either deployed to the cluster OR (prevails if both) running locally with make [install] run command. Works only with USE_EXISTING_CLUSTER=true

    So, in most of the cases

    • Make sure you test desirable version of Operator image, that's what make image-build image-push does. See Makefile what version <your-mage> has.
    • Prepare your cluster with:
      • make install deploy this will install CR and deploy Controller to backstage-system
      • make integration-test USE_EXISTING_CLUSTER=true USE_EXISTING_CONTROLLER=true

To run GINKGO with command line arguments (see https://onsi.github.io/ginkgo/#running-specs) use 'ARGS' environment variable. For example to run specific test(s) you can use something like:

make integration-test ARGS='--focus "my favorite test"'

NOTE:

Some tests are Openshift specific only and skipped in a local envtest and bare k8s cluster.

if !isOpenshiftCluster() { Skip("Skipped for non-Openshift cluster") }

Some tests are workable only in real (EXISTING) cluster and skipped in envtest.

if !*testEnv.UseExistingCluster { Skip("Skipped for not real cluster") }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeAddedAsArgToContainer

func BeAddedAsArgToContainer(c corev1.Container) types.GomegaMatcher

Matcher for container Args

func BeAddedAsVolumeToPodSpec

func BeAddedAsVolumeToPodSpec(ps corev1.PodSpec) types.GomegaMatcher

Matcher for PodSpec Volumes

func BeEnvFromForContainer

func BeEnvFromForContainer(c corev1.Container) types.GomegaMatcher

Matcher for Container EnvFrom

func BeEnvVarForContainer

func BeEnvVarForContainer(c corev1.Container) types.GomegaMatcher

Matcher for Container Env Var

func BeMountedToContainer

func BeMountedToContainer(c corev1.Container) types.GomegaMatcher

Matcher for Container VolumeMounts

func ReadYaml

func ReadYaml(manifest []byte, object interface{}) error

func ReadYamlFile

func ReadYamlFile(path string, object interface{}) error

Types

type BeAddedAsArgToContainerMatcher

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

func (*BeAddedAsArgToContainerMatcher) FailureMessage

func (matcher *BeAddedAsArgToContainerMatcher) FailureMessage(actual interface{}) string

func (*BeAddedAsArgToContainerMatcher) Match

func (matcher *BeAddedAsArgToContainerMatcher) Match(actual interface{}) (bool, error)

func (*BeAddedAsArgToContainerMatcher) NegatedFailureMessage

func (matcher *BeAddedAsArgToContainerMatcher) NegatedFailureMessage(actual interface{}) string

type BeAddedAsVolumeToPodSpecMatcher

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

func (*BeAddedAsVolumeToPodSpecMatcher) FailureMessage

func (matcher *BeAddedAsVolumeToPodSpecMatcher) FailureMessage(actual interface{}) string

func (*BeAddedAsVolumeToPodSpecMatcher) Match

func (matcher *BeAddedAsVolumeToPodSpecMatcher) Match(actual interface{}) (bool, error)

func (*BeAddedAsVolumeToPodSpecMatcher) NegatedFailureMessage

func (matcher *BeAddedAsVolumeToPodSpecMatcher) NegatedFailureMessage(actual interface{}) string

type BeEnvFromForContainerMatcher

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

func (*BeEnvFromForContainerMatcher) FailureMessage

func (matcher *BeEnvFromForContainerMatcher) FailureMessage(actual interface{}) string

func (*BeEnvFromForContainerMatcher) Match

func (matcher *BeEnvFromForContainerMatcher) Match(actual interface{}) (bool, error)

func (*BeEnvFromForContainerMatcher) NegatedFailureMessage

func (matcher *BeEnvFromForContainerMatcher) NegatedFailureMessage(actual interface{}) string

type BeEnvVarForContainerMatcher

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

func (*BeEnvVarForContainerMatcher) FailureMessage

func (matcher *BeEnvVarForContainerMatcher) FailureMessage(actual interface{}) string

func (*BeEnvVarForContainerMatcher) Match

func (matcher *BeEnvVarForContainerMatcher) Match(actual interface{}) (bool, error)

func (*BeEnvVarForContainerMatcher) NegatedFailureMessage

func (matcher *BeEnvVarForContainerMatcher) NegatedFailureMessage(actual interface{}) string

type BeMountedToContainerMatcher

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

func (*BeMountedToContainerMatcher) FailureMessage

func (matcher *BeMountedToContainerMatcher) FailureMessage(actual interface{}) string

func (*BeMountedToContainerMatcher) Match

func (matcher *BeMountedToContainerMatcher) Match(actual interface{}) (bool, error)

func (*BeMountedToContainerMatcher) NegatedFailureMessage

func (matcher *BeMountedToContainerMatcher) NegatedFailureMessage(actual interface{}) string

Jump to

Keyboard shortcuts

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