github.com/chenbh/concourse/v6@v6.4.2/worker/runtime/integration/suite_test.go (about) 1 package integration_test 2 3 import ( 4 "io/ioutil" 5 "sync" 6 "testing" 7 8 gouuid "github.com/nu7hatch/gouuid" 9 "github.com/stretchr/testify/require" 10 "github.com/stretchr/testify/suite" 11 ) 12 13 type buffer struct { 14 content string 15 sync.Mutex 16 } 17 18 func (m *buffer) Write(p []byte) (n int, err error) { 19 m.Lock() 20 m.content += string(p) 21 m.Unlock() 22 return len(p), nil 23 } 24 25 func (m *buffer) String() string { 26 return m.content 27 } 28 29 func uuid() string { 30 u4, err := gouuid.NewV4() 31 if err != nil { 32 panic("couldn't create new uuid") 33 } 34 35 return u4.String() 36 } 37 38 func TestSuite(t *testing.T) { 39 tmpDir, err := ioutil.TempDir("", "containerd-test") 40 if err != nil { 41 panic(err) 42 } 43 suite.Run(t, &IntegrationSuite{ 44 Assertions: require.New(t), 45 tmpDir: tmpDir, 46 }) 47 }