github.com/cloudfoundry-attic/garden-linux@v0.333.2-candidate/integration/graph/suite_test.go (about)

     1  package graph_test
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  	"time"
     7  
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  
    11  	"github.com/cloudfoundry-incubator/garden-linux/integration/runner"
    12  )
    13  
    14  var rootFSPath = os.Getenv("GARDEN_TEST_ROOTFS")
    15  var client *runner.RunningGarden
    16  
    17  func startGarden(argv ...string) *runner.RunningGarden {
    18  	return runner.Start(argv...)
    19  }
    20  
    21  func TestGraph(t *testing.T) {
    22  	BeforeEach(func() {
    23  		if rootFSPath == "" {
    24  			Skip("GARDEN_TEST_ROOTFS undefined")
    25  		}
    26  	})
    27  
    28  	AfterEach(func() {
    29  		err := client.DestroyAndStop()
    30  		client.Cleanup()
    31  		Expect(err).NotTo(HaveOccurred())
    32  	})
    33  
    34  	SetDefaultEventuallyTimeout(5 * time.Second) // CI is sometimes slow
    35  
    36  	RegisterFailHandler(Fail)
    37  	RunSpecs(t, "Graph Suite")
    38  }