testprojects

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersionLocatorFromStackDefinitionForMemberName added in v1.33.0

func GetVersionLocatorFromStackDefinitionForMemberName(pathToStackDefinition string, memberName string) (string, error)

Types

type TestProjectsOptions

type TestProjectsOptions struct {
	// REQUIRED: a pointer to an initialized testing object.
	// Typically you would assign the test object used in the unit test.
	Testing *testing.T `copier:"-"`

	// The default constructors will use this map to check that all required environment variables are set properly.
	// If any are missing, the test will fail.
	RequiredEnvironmentVars map[string]string

	// Only required if using the WithVars constructor, as this value will then populate the `resource_group` input variable.
	// This resource group will be used to create the project and stack.
	ResourceGroup string

	// REQUIRED: the string prefix that will be prepended to all resource names, typically sent in as terraform input variable.
	// Set this value in the default constructors and a unique 6-digit random string will be appended.
	// Can then be referenced after construction and used as unique variable.
	//
	// Example:
	// Supplied to constructor = `my-test`
	// After constructor = `my-test-xu5oby`
	Prefix string

	ProjectName        string
	ProjectDescription string

	CloudInfoService cloudinfo.CloudInfoServiceI // OPTIONAL: Supply if you need multiple tests to share info service and data

	// ProjectsApiURL Base URL of the schematics REST API. Set to override default.
	// Default: https://projects.api.cloud.ibm.com
	ProjectsApiURL string

	// ConfigrationPath Path to the configuration file that will be used to create the project.
	ConfigrationPath string
	// StackConfigurationPath Path to the configuration file that will be used to create the stack.
	StackConfigurationPath  string
	StackCatalogJsonPath    string
	StackConfigurationOrder []string
	StackUndeployOrder      []string

	// StackMemberInputs [ "primary-da": {["input1": "value1", "input2": 2]}, "secondary-da": {["input1": "value1", "input2": 2]}]
	StackMemberInputs map[string]map[string]interface{}
	// StackInputs {"input1": "value1", "input2": 2}
	StackInputs map[string]interface{}

	// ParallelDeploy If set to true, the test will deploy the stack in parallel.
	// This will deploy the stack in batches of whatever is not waiting on a prerequisite to be deployed.
	// Note Undeploy will still be in serial.
	ParallelDeploy bool

	ValidationTimeoutMinutes int
	DeployTimeoutMinutes     int

	// If you want to skip teardown use this flag
	SkipTestTearDown  bool
	SkipUndeploy      bool
	SkipProjectDelete bool
	// contains filtered or unexported fields
}

func TestProjectOptionsDefault

func TestProjectOptionsDefault(originalOptions *TestProjectsOptions) *TestProjectsOptions

TestProjectOptionsDefault Default constructor for TestProjectsOptions This function will accept an existing instance of TestProjectOptions values, and return a new instance of TestProjectOptions with the original values set along with appropriate default values for any properties that were not set in the original options. Summary of default values: - Prefix: original prefix with a unique 6-digit random string appended - DefaultRegion: if not set, will be determined by dynamic region selection - Region: if not set, will be determined by dynamic region selection - BestRegionYAMLPath: if not set, will use the default region YAML path

func (*TestProjectsOptions) ApproveConfig added in v1.34.0

func (options *TestProjectsOptions) ApproveConfig(configName string) error

func (*TestProjectsOptions) Clone

func (options *TestProjectsOptions) Clone() (*TestProjectsOptions, error)

Clone makes a deep copy of most fields on the Options object and returns it.

NOTE: options.SshAgent and options.Logger CANNOT be deep copied (e.g., the SshAgent struct contains channels and listeners that can't be meaningfully copied), so the original values are retained.

func (*TestProjectsOptions) ConfigureTestStack added in v1.34.0

func (options *TestProjectsOptions) ConfigureTestStack() error

func (*TestProjectsOptions) DeployConfig added in v1.34.0

func (options *TestProjectsOptions) DeployConfig(configName string) error

func (*TestProjectsOptions) ParallelDeployConfigurations added in v1.34.0

func (options *TestProjectsOptions) ParallelDeployConfigurations() []error

func (*TestProjectsOptions) RunProjectsTest

func (options *TestProjectsOptions) RunProjectsTest() error

RunProjectsTest : Run the test for the projects service Creates a new project Adds a configuration Deploys the configuration Deletes the project

func (*TestProjectsOptions) SerialDeployConfigurations added in v1.34.0

func (options *TestProjectsOptions) SerialDeployConfigurations() error

func (*TestProjectsOptions) TestTearDown

func (options *TestProjectsOptions) TestTearDown()

func (*TestProjectsOptions) ValidateApproveDeploy added in v1.34.0

func (options *TestProjectsOptions) ValidateApproveDeploy(configName string) error

func (*TestProjectsOptions) ValidateConfig added in v1.34.0

func (options *TestProjectsOptions) ValidateConfig(configName string) error

Jump to

Keyboard shortcuts

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