framework

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var Scheme = runtime.NewScheme()
View Source
var TargetSecretName = "target-secret"

Functions

func NewConfig

func NewConfig() (*rest.Config, *kubernetes.Clientset, crclient.Client)

NewConfig loads and returns the kubernetes credentials from the environment. KUBECONFIG env var takes precedence and falls back to in-cluster config.

func TableFunc added in v0.3.0

func TableFunc(f *Framework, prov SecretStoreProvider) func(...func(*TestCase))

TableFunc returns the main func that runs a TestCase in a table driven test.

Types

type Framework

type Framework struct {
	BaseName string

	// KubeConfig which was used to create the connection.
	KubeConfig *rest.Config

	// Kubernetes API clientsets
	KubeClientSet kubernetes.Interface

	// controller-runtime client for newer controllers
	CRClient crclient.Client

	// Namespace in which all test resources should reside
	Namespace *api.Namespace

	Addons []addon.Addon
}

func New

func New(baseName string) *Framework

New returns a new framework instance with defaults.

func (*Framework) AfterEach

func (f *Framework) AfterEach()

AfterEach deletes the namespace and cleans up the registered addons.

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

BeforeEach creates a namespace.

func (*Framework) Install added in v0.3.3

func (f *Framework) Install(a addon.Addon)

func (*Framework) WaitForSecretValue

func (f *Framework) WaitForSecretValue(namespace, name string, expected *v1.Secret) (*v1.Secret, error)

WaitForSecretValue waits until a secret comes into existence and compares the secret.Data with the provided values.

type SecretStoreProvider added in v0.3.0

type SecretStoreProvider interface {
	CreateSecret(key string, val string)
	DeleteSecret(key string)
}

SecretStoreProvider is a interface that must be implemented by a provider that runs the e2e test.

type TestCase added in v0.3.0

type TestCase struct {
	Framework      *Framework
	ExternalSecret *esv1alpha1.ExternalSecret
	Secrets        map[string]string
	ExpectedSecret *v1.Secret
}

TestCase contains the test infra to run a table driven test.

Directories

Path Synopsis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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