config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config provides the configuration for the test engine client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AccessToken is the access token for the API.
	AccessToken string
	// Identifier is the identifier of the build.
	Identifier string
	// MaxRetries is the maximum number of retries for a failed test.
	MaxRetries int
	// RetryCommand is the command to run the retry tests.
	RetryCommand string
	// Node index is index of the current node.
	NodeIndex int
	// OrganizationSlug is the slug of the organization.
	OrganizationSlug string
	// Parallelism is the number of parallel tasks to run.
	Parallelism int
	// The path to the result file.
	ResultPath string
	// ServerBaseUrl is the base URL of the test plan server.
	ServerBaseUrl string
	// SplitByExample is the flag to enable split the test by example.
	SplitByExample bool
	// SuiteSlug is the slug of the suite.
	SuiteSlug string
	// TestCommand is the command to run the tests.
	TestCommand string
	// TestFilePattern is the pattern to match the test files.
	TestFilePattern string
	// TestFileExcludePattern is the pattern to exclude the test files.
	TestFileExcludePattern string
	// TestRunner is the name of the runner.
	TestRunner string
	// Branch is the string value of the git branch name, used by Buildkite only.
	Branch string
	// JobRetryCount is the count of the number of times the job has been retried.
	JobRetryCount int
	// contains filtered or unexported fields
}

Config is the internal representation of the complete test engine client configuration.

func New

func New() (Config, error)

New wraps the readFromEnv and validate functions to create a new Config struct. It returns Config struct and an InvalidConfigError if there is an invalid configuration.

func (Config) DumpEnv

func (c Config) DumpEnv() map[string]string

type InvalidConfigError

type InvalidConfigError map[string][]error

InvalidConfigError is an error that contains a map of all validation errors on each field of the configuration.

func (InvalidConfigError) Error

func (i InvalidConfigError) Error() string

Jump to

Keyboard shortcuts

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