Exemple #1
0
	"os"
	"strings"
	"testing"
	"time"

	"github.com/garyburd/redigo/redis"
	"github.com/gmlexx/redigomock"
	"github.com/moira-alert/cache/filter"
	. "github.com/onsi/ginkgo"
	"github.com/onsi/ginkgo/reporters"
	. "github.com/onsi/gomega"
)

var (
	tcReport = flag.Bool("teamcity", false, "enable TeamCity reporting format")
	db       *filter.DbConnector
	cache    *filter.CacheStorage
	patterns *filter.PatternStorage
)

func TestCache(t *testing.T) {
	flag.Parse()

	RegisterFailHandler(Fail)
	if *tcReport {
		RunSpecsWithCustomReporters(t, "Cache Suite", []Reporter{reporters.NewTeamCityReporter(os.Stdout)})
	} else {
		RunSpecs(t, "Cache Suite")
	}
}

var _ = Describe("Cache", func() {
Exemple #2
0
	"os"
	"strings"
	"testing"
	"time"

	"github.com/garyburd/redigo/redis"
	"github.com/gmlexx/redigomock"
	"github.com/moira-alert/cache/filter"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var (
	db       *filter.DbConnector
	cache    *filter.CacheStorage
	patterns *filter.PatternStorage

	testMetricsLines []string
)

func TestCache(t *testing.T) {
	flag.Parse()

	RegisterFailHandler(Fail)
	RunSpecs(t, "Cache Suite")
}

var _ = Describe("Cache", func() {
	testRetentions := `
	# comment
	[simple]