config

package
v0.0.0-...-3924ef3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateTestFixture

func PopulateTestFixture(userConfig UserConfig, runId string, amiId ...string) (err error)

PopulateTestFixture populates the test fixture which contains constant information for the entire run.

func RestoreTestFixture

func RestoreTestFixture(data []byte) (err error)

RestoreTestFixture populates the test fixture from a previous state

func SetTestFixtureBucketName

func SetTestFixtureBucketName(bucketName string)

SetTestFixtureBucketName sets bucketName of testFixture.

func WriteUserConfig

func WriteUserConfig(filename string) error

WriteUserConfig writes user config to config file.

Types

type TestFixture

type TestFixture struct {
	RunId                   string `json:"runId"`
	TestSuiteName           string `json:"test-suite"`
	CompressedTestSuiteName string `json:"compressed-test-suite"`
	BucketName              string `json:"bucket-name"`
	BucketRootDir           string `json:"bucket-root-dir"`
	CpuThreshold            int    `json:"cpu-threshold"`
	MemThreshold            int    `json:"mem-threshold"`
	Timeout                 int    `json:"timeout"`
	CfnStackName            string `json:"stack-name"`
	FinalResultFilename     string `json:"final-results"`
	UserConfigFilename      string `json:"user-config"`
	CfnTemplateFilename     string `json:"cfn-template"`
	AmiId                   string `json:"ami"`
	StartTime               string `json:"start-time"`
}

TestFixture contains constant information for the entire run.

func GetTestFixture

func GetTestFixture() TestFixture

GetTestFixture returns testFixture.

func (TestFixture) String

func (TestFixture) String() string

String returns a pretty string representation of TestFixture

type UserConfig

type UserConfig struct {
	InstanceTypes    string `json:"instance-types"`
	TestSuiteName    string `json:"test-suite"`
	CpuThreshold     int    `json:"cpu-threshold"`
	MemThreshold     int    `json:"mem-threshold"`
	VpcId            string `json:"vpc"`
	SubnetId         string `json:"subnet"`
	AmiId            string `json:"ami"`
	Timeout          int    `json:"timeout"`
	Persist          bool   `json:"persist"`
	Profile          string `json:"profile"`
	Region           string `json:"region"`
	Bucket           string `json:"bucket"`
	CustomScriptPath string `json:"custom-script"`
	ConfigFilePath   string `json:"config-file"`
}

UserConfig contains configuration provided by the user, which remains unchanged throughout the entire run.

func GetUserConfig

func GetUserConfig() UserConfig

GetUserConfig returns userConfig.

func ParseCliArgs

func ParseCliArgs(outputStream *os.File) (UserConfig, error)

ParseCliArgs parses CLI arguments and uses environment variables as fallback values for some flags.

func ReadUserConfig

func ReadUserConfig(filename string) (UserConfig, error)

ReadUserConfig reads user config from config file.

func (UserConfig) SetUserConfig

func (UserConfig) SetUserConfig(reqConfig UserConfig)

SetUserConfig sets empty fields of UserConfig to reqConfig nolint: gocyclo

func (UserConfig) String

func (UserConfig) String() string

String returns a pretty string representation of UserConfig

Jump to

Keyboard shortcuts

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