github.com/anuvu/nomad@v0.8.7-atom1/nomad/state/testing.go (about)

     1  package state
     2  
     3  import (
     4  	"github.com/hashicorp/nomad/helper/testlog"
     5  	"github.com/mitchellh/go-testing-interface"
     6  )
     7  
     8  func TestStateStore(t testing.T) *StateStore {
     9  	config := &StateStoreConfig{
    10  		LogOutput: testlog.NewWriter(t),
    11  		Region:    "global",
    12  	}
    13  	state, err := NewStateStore(config)
    14  	if err != nil {
    15  		t.Fatalf("err: %v", err)
    16  	}
    17  	if state == nil {
    18  		t.Fatalf("missing state")
    19  	}
    20  	TestInitState(t, state)
    21  	return state
    22  }