framework

package
v0.0.0-...-53afbcf Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 19 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 TargetSecretName = "target-secret"

Functions

func Compose

func Compose(descAppend string, f *Framework, fn func(f *Framework) (string, func(*TestCase)), tweaks ...func(*TestCase)) TableEntry

Compose helps define multiple testcases with same/different auth methods.

func TableFunc

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

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 SecretEntry

type SecretEntry struct {
	Value string
	Tags  map[string]string
}

type SecretStoreProvider

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

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

type TestCase

type TestCase struct {
	Framework              *Framework
	ExternalSecret         *esv1beta1.ExternalSecret
	ExternalSecretV1Alpha1 *esv1alpha1.ExternalSecret
	Secrets                map[string]SecretEntry
	ExpectedSecret         *v1.Secret
	AfterSync              func(SecretStoreProvider, *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