2018-06-28 17:29:26 +00:00
|
|
|
package example
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/nomad/e2e/framework"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
framework.AddSuites(&framework.TestSuite{
|
|
|
|
Component: "simple",
|
|
|
|
CanRunLocal: true,
|
|
|
|
Cases: []framework.TestCase{
|
|
|
|
new(SimpleExampleTestCase),
|
2018-07-12 19:06:14 +00:00
|
|
|
new(ExampleLongSetupCase),
|
2018-06-28 17:29:26 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type SimpleExampleTestCase struct {
|
|
|
|
framework.TC
|
|
|
|
}
|
|
|
|
|
2018-07-10 19:57:02 +00:00
|
|
|
func (tc *SimpleExampleTestCase) TestExample(f *framework.F) {
|
2018-07-12 19:06:14 +00:00
|
|
|
f.T().Log("Logging foo")
|
2018-06-28 17:29:26 +00:00
|
|
|
jobs, _, err := tc.Nomad().Jobs().List(nil)
|
2018-07-10 19:57:02 +00:00
|
|
|
f.NoError(err)
|
|
|
|
f.Empty(jobs)
|
2018-06-28 17:29:26 +00:00
|
|
|
}
|
2018-07-12 19:06:14 +00:00
|
|
|
|
2018-07-27 03:49:53 +00:00
|
|
|
func (tc *SimpleExampleTestCase) TestParallelExample(f *framework.F) {
|
|
|
|
f.T().Log("this one can run in parallel with other tests")
|
|
|
|
f.T().Parallel()
|
2018-07-12 19:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ExampleLongSetupCase struct {
|
|
|
|
framework.TC
|
|
|
|
}
|
|
|
|
|
|
|
|
func (tc *ExampleLongSetupCase) BeforeEach(f *framework.F) {
|
2018-07-27 03:49:53 +00:00
|
|
|
f.T().Log("Logging before each")
|
2018-07-12 19:06:14 +00:00
|
|
|
}
|