github.com/sequix/cortex@v1.1.6/pkg/chunk/storage/factory_test.go (about)

     1  package storage
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/prometheus/common/model"
     7  	"github.com/stretchr/testify/require"
     8  
     9  	"github.com/sequix/cortex/pkg/chunk"
    10  	"github.com/sequix/cortex/pkg/util/flagext"
    11  	"github.com/sequix/cortex/pkg/util/validation"
    12  )
    13  
    14  func TestFactoryStop(t *testing.T) {
    15  	var (
    16  		cfg          Config
    17  		storeConfig  chunk.StoreConfig
    18  		schemaConfig chunk.SchemaConfig
    19  		defaults     validation.Limits
    20  	)
    21  	flagext.DefaultValues(&cfg, &storeConfig, &schemaConfig, &defaults)
    22  	schemaConfig.Configs = []chunk.PeriodConfig{
    23  		{
    24  			From:      chunk.DayTime{Time: model.Time(0)},
    25  			IndexType: "inmemory",
    26  		},
    27  		{
    28  			From:      chunk.DayTime{Time: model.Time(1)},
    29  			IndexType: "inmemory",
    30  		},
    31  	}
    32  
    33  	limits, err := validation.NewOverrides(defaults)
    34  	require.NoError(t, err)
    35  
    36  	store, err := NewStore(cfg, storeConfig, schemaConfig, limits)
    37  	require.NoError(t, err)
    38  
    39  	store.Stop()
    40  }