package metrics

import (
	"testing"

	"github.com/golang/mock/gomock"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/prometheus/common/model"

	"github.com/pingcap/endless/pkg/util"
)

//go:generate mockgen -destination generated/mock_prometheus_api.go -mock_names API=MockPrometheusAPI -package mock github.com/prometheus/client_golang/api/prometheus/v1 API
//go:generate mockgen -destination generated/mock_tc.go -mock_names API=MockTiDBCluster -package mock github.com/pingcap/test-infra/sdk/resource TiDBCluster

var (
	PrometheusNonemptyScalar = model.Value(&model.Scalar{
		Value:     42.42,
		Timestamp: 0,
	})
	PrometheusEmptyVector = model.Value(model.Vector{})
)

var GomockController *gomock.Controller

func TestMetrics(t *testing.T) {
	RegisterFailHandler(Fail)

	GomockController = gomock.NewController(t)

	RunSpecs(t, "Metrics Suite")
}

func init() {
	util.SetLogLevelFromEnv()
}
