Documentation ¶
Overview ¶
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
Index ¶
- func AddSuites(s ...*TestSuite)deprecated
- func Run(t *testing.T)deprecated
- type AfterAllTestsdeprecated
- type AfterEachTestdeprecated
- type BeforeAllTestsdeprecated
- type BeforeEachTestdeprecated
- type ClusterInfodeprecated
- type Constraintsdeprecated
- type Environmentdeprecated
- type Fdeprecated
- type Frameworkdeprecated
- func New() *Frameworkdeprecated
- type Provisionerdeprecated
- type SetupOptionsdeprecated
- type TCdeprecated
- type TestCasedeprecated
- type TestSuitedeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AfterAllTests
deprecated
type AfterAllTests interface {
AfterAll(*F)
}
AfterAllTests is used to define a method to be called after the execution of all tests.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type AfterEachTest
deprecated
type AfterEachTest interface {
AfterEach(*F)
}
AfterEachTest is used to define a method to be called after each test.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type BeforeAllTests
deprecated
type BeforeAllTests interface {
BeforeAll(*F)
}
BeforeAllTests is used to define a method to be called before the execution of all tests.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type BeforeEachTest
deprecated
type BeforeEachTest interface {
BeforeEach(*F)
}
BeforeEachTest is used to define a method to be called before each test.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type ClusterInfo
deprecated
type ClusterInfo struct { ID string Name string NomadClient *napi.Client ConsulClient *capi.Client VaultClient *vapi.Client }
ClusterInfo is a handle to a provisioned cluster, along with clients a test run can use to connect to the cluster.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type Constraints
deprecated
type Constraints struct { Provider string // Cloud provider ex. 'aws', 'azure', 'gcp' OS string // Operating system ex. 'windows', 'linux' Arch string // CPU architecture ex. 'amd64', 'arm64' Environment string // Environment name ex. 'simple' Tags []string // Generic tags that must all exist in the environment }
Constraints that must be satisfied for a TestSuite to run
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type Environment
deprecated
type Environment struct { Name string Provider string OS string Arch string Tags map[string]struct{} }
Environment contains information about the test target environment, used to constrain the set of tests run. See the environment flags above.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type F
deprecated
type F struct { *require.Assertions // contains filtered or unexported fields }
F is the framework context that is passed to each test. It is used to access the *testing.T context as well as testify helpers
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
func (*F) Assert
deprecated
func (f *F) Assert() *assert.Assertions
Assert fetches an assert flavor of testify assertions https://godoc.org/github.com/stretchr/testify/assert
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type Framework
deprecated
type Framework struct {
// contains filtered or unexported fields
}
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type Provisioner
deprecated
type Provisioner interface { // SetupTestRun is called at the start of the entire test run. SetupTestRun(t *testing.T, opts SetupOptions) (*ClusterInfo, error) // SetupTestSuite is called at the start of each TestSuite. // TODO: no current provisioner implementation uses this, but we // could use it to provide each TestSuite with an entirely separate // Nomad cluster. SetupTestSuite(t *testing.T, opts SetupOptions) (*ClusterInfo, error) // SetupTestCase is called at the start of each TestCase in every TestSuite. SetupTestCase(t *testing.T, opts SetupOptions) (*ClusterInfo, error) // TearDownTestCase is called after each TestCase in every TestSuite. TearDownTestCase(t *testing.T, clusterID string) error // TearDownTestSuite is called after every TestSuite. TearDownTestSuite(t *testing.T, clusterID string) error // TearDownTestRun is called at the end of the entire test run. TearDownTestRun(t *testing.T, clusterID string) error }
Provisioner interface is used by the test framework to provision API clients for a Nomad cluster, with the possibility of extending to provision standalone clusters for each test case in the future.
The Setup* methods are hooks that get run at the appropriate stage. They return a ClusterInfo handle that helps TestCases isolate test state if they use the ClusterInfo.ID as part of job IDs.
The TearDown* methods are hooks to clean up provisioned cluster state that isn't covered by the test case's implementation of AfterEachTest.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
var DefaultProvisioner Provisioner = new(singleClusterProvisioner)
DefaultProvisioner is a Provisioner that doesn't deploy a Nomad cluster (because that's handled by Terraform elsewhere), but build clients from environment variables.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type SetupOptions
deprecated
added in
v1.0.0
type SetupOptions struct { Name string ExpectConsul bool // If true, fails if a Consul client can't be configured ExpectVault bool // If true, fails if a Vault client can't be configured }
SetupOptions defines options to be given to the Provisioner when calling Setup* methods.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type TC
deprecated
type TC struct {
// contains filtered or unexported fields
}
TC is the base test case which should be embedded in TestCase implementations.
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type TestCase
deprecated
type TestCase interface { Name() string // contains filtered or unexported methods }
TestCase is the interface which an E2E test case implements. It is not meant to be implemented directly, instead the struct should embed the 'framework.TC' struct
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.
type TestSuite
deprecated
type TestSuite struct { Component string // Name of the component/system/feature tested CanRunLocal bool // Flags if the cases are safe to run on a local nomad cluster Cases []TestCase // Cases to run Constraints Constraints // Environment constraints to follow Parallel bool // If true, will run test cases in parallel Slow bool // Slow test suites don't run by default // API Clients Consul bool Vault bool }
TestSuite defines a set of test cases and under what conditions to run them
Deprecated: no longer use e2e/framework for new tests; see TestExample for new e2e test structure.