github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/integration/global/global_suite_test.go (about) 1 package global 2 3 import ( 4 "time" 5 6 "code.cloudfoundry.org/cli/integration/helpers" 7 8 . "github.com/onsi/ginkgo" 9 . "github.com/onsi/gomega" 10 11 "testing" 12 ) 13 14 const ( 15 CFEventuallyTimeout = 30 * time.Second 16 ) 17 18 var ( 19 // Per Test Level 20 homeDir string 21 ) 22 23 func TestGlobal(t *testing.T) { 24 RegisterFailHandler(Fail) 25 RunSpecs(t, "Global Suite") 26 } 27 28 var _ = SynchronizedBeforeSuite(func() []byte { 29 // Ginkgo Globals 30 SetDefaultEventuallyTimeout(CFEventuallyTimeout) 31 32 // Setup common environment variables 33 helpers.TurnOffColors() 34 return nil 35 }, func(_ []byte) { 36 if GinkgoParallelNode() != 1 { 37 Fail("Test suite cannot run in parallel") 38 } 39 }) 40 41 var _ = BeforeEach(func() { 42 homeDir = helpers.SetHomeDir() 43 helpers.SetAPI() 44 }) 45 46 var _ = AfterEach(func() { 47 helpers.DestroyHomeDir(homeDir) 48 }) 49 50 func setupCF(org string, space string) { 51 helpers.LoginCF() 52 helpers.CreateOrgAndSpace(org, space) 53 helpers.TargetOrgAndSpace(org, space) 54 }