2018-06-28 17:29:26 +00:00
|
|
|
package framework
|
|
|
|
|
2020-01-22 13:48:52 +00:00
|
|
|
import "github.com/hashicorp/nomad/e2e/framework/provisioning"
|
|
|
|
|
2018-06-28 19:55:53 +00:00
|
|
|
// 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
|
2018-06-28 17:29:26 +00:00
|
|
|
type TestCase interface {
|
|
|
|
internalTestCase
|
|
|
|
|
2018-06-28 19:55:53 +00:00
|
|
|
Name() string
|
2018-06-28 17:29:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type internalTestCase interface {
|
2020-01-22 13:48:52 +00:00
|
|
|
setClusterInfo(*provisioning.ClusterInfo)
|
2018-06-28 17:29:26 +00:00
|
|
|
}
|
|
|
|
|
2018-07-03 18:26:05 +00:00
|
|
|
// BeforeAllTests is used to define a method to be called before the execution
|
|
|
|
// of all tests.
|
|
|
|
type BeforeAllTests interface {
|
2018-07-10 19:57:02 +00:00
|
|
|
BeforeAll(*F)
|
2018-06-28 17:29:26 +00:00
|
|
|
}
|
|
|
|
|
2018-07-03 18:26:05 +00:00
|
|
|
// AfterAllTests is used to define a method to be called after the execution of
|
|
|
|
// all tests.
|
|
|
|
type AfterAllTests interface {
|
2018-07-10 19:57:02 +00:00
|
|
|
AfterAll(*F)
|
2018-06-28 17:29:26 +00:00
|
|
|
}
|
|
|
|
|
2018-07-03 18:26:05 +00:00
|
|
|
// BeforeEachTest is used to define a method to be called before each test.
|
|
|
|
type BeforeEachTest interface {
|
2018-07-10 19:57:02 +00:00
|
|
|
BeforeEach(*F)
|
2018-06-28 17:29:26 +00:00
|
|
|
}
|
|
|
|
|
2018-07-03 18:26:05 +00:00
|
|
|
// AfterEachTest is used to degine a method to be called after each test.
|
|
|
|
type AfterEachTest interface {
|
2018-07-10 19:57:02 +00:00
|
|
|
AfterEach(*F)
|
2018-06-28 17:29:26 +00:00
|
|
|
}
|