github.com/smithx10/nomad@v0.9.1-rc1/e2e/example/example.go (about)

     1  package example
     2  
     3  import (
     4  	"github.com/hashicorp/nomad/e2e/framework"
     5  )
     6  
     7  func init() {
     8  	framework.AddSuites(&framework.TestSuite{
     9  		Component:   "simple",
    10  		CanRunLocal: true,
    11  		Cases: []framework.TestCase{
    12  			new(SimpleExampleTestCase),
    13  			new(ExampleLongSetupCase),
    14  		},
    15  	})
    16  }
    17  
    18  type SimpleExampleTestCase struct {
    19  	framework.TC
    20  }
    21  
    22  func (tc *SimpleExampleTestCase) TestExample(f *framework.F) {
    23  	f.T().Log("Logging foo")
    24  	jobs, _, err := tc.Nomad().Jobs().List(nil)
    25  	f.NoError(err)
    26  	f.Empty(jobs)
    27  }
    28  
    29  func (tc *SimpleExampleTestCase) TestParallelExample(f *framework.F) {
    30  	f.T().Log("this one can run in parallel with other tests")
    31  	f.T().Parallel()
    32  }
    33  
    34  type ExampleLongSetupCase struct {
    35  	framework.TC
    36  }
    37  
    38  func (tc *ExampleLongSetupCase) BeforeEach(f *framework.F) {
    39  	f.T().Log("Logging before each")
    40  }