base

package
v1.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseTestingSuite

type BaseTestingSuite struct {
	suite.Suite
	Ctx              context.Context
	TestInstallation *e2e.TestInstallation
	TestHelper       *helper.SoloTestHelper
	TestCase         map[string]*TestCase
	Setup            SimpleTestCase
}

func NewBaseTestingSuite

func NewBaseTestingSuite(ctx context.Context, testInst *e2e.TestInstallation, testHelper *helper.SoloTestHelper, setup SimpleTestCase, testCase map[string]*TestCase) *BaseTestingSuite

NewBaseTestingSuite returns a BaseTestingSuite that performs all the pre-requisites of upgrading helm installations, applying manifests and verifying resources exist before a suite and tests and the corresponding post-run cleanup. The pre-requisites for the suite are defined in the setup parameter and for each test in the individual testCase. Currently, tests that require upgrades (eg: to change settings) can not be run in Enterprise. To do so, the test must be written without upgrades and call the `NewBaseTestingSuiteWithoutUpgrades` constructor.

func NewBaseTestingSuiteWithoutUpgrades added in v1.18.0

func NewBaseTestingSuiteWithoutUpgrades(ctx context.Context, testInst *e2e.TestInstallation, setup SimpleTestCase, testCase map[string]*TestCase) *BaseTestingSuite

NewBaseTestingSuiteWithoutUpgrades returns a BaseTestingSuite without allowing upgrades and reverts before the suite and tests. This is useful when creating tests that need to run in Enterprise since the helm values change between OSS and Enterprise installations.

func (*BaseTestingSuite) AfterTest

func (s *BaseTestingSuite) AfterTest(suiteName, testName string)

func (*BaseTestingSuite) BeforeTest

func (s *BaseTestingSuite) BeforeTest(suiteName, testName string)

func (*BaseTestingSuite) GetKubectlOutput

func (s *BaseTestingSuite) GetKubectlOutput(command ...string) string

func (*BaseTestingSuite) SetupSuite

func (s *BaseTestingSuite) SetupSuite()

func (*BaseTestingSuite) TearDownSuite

func (s *BaseTestingSuite) TearDownSuite()

func (*BaseTestingSuite) UpgradeWithCustomValuesFile

func (s *BaseTestingSuite) UpgradeWithCustomValuesFile(valuesFile string)

type SimpleTestCase

type SimpleTestCase struct {
	// manifest files
	Manifests []string
	// Resources expected to be created by manifest
	Resources []client.Object
	// values file passed during an upgrade
	UpgradeValues string
	// Rollback method to be called during cleanup.
	// Do not provide this. Calling an upgrade returns this method which we save
	Rollback func() error
}

SimpleTestCase defines the resources used by a specific test

type TestCase

type TestCase struct {
	// SimpleTestCase defines the resources used by a specific test
	SimpleTestCase
	// SubTestCases contains a map for hierarchial tests within the current test
	// Eg: TestRateLimit
	//      |- OnVhost
	//      |- OnRoute
	SubTestCases map[string]*TestCase
}

This defines a test case used by the BaseTestingSuite

Jump to

Keyboard shortcuts

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