package random_failpoint_test

import (
	"errors"
	"os"
	"testing"

	"github.com/joho/godotenv"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	infra_core "github.com/pingcap/test-infra/sdk/core"
	_ "github.com/pingcap/test-infra/sdk/resource/impl/k8s"
	_ "github.com/pingcap/test-infra/sdk/resource/impl/local"

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

var (
	suiteTestCtx infra_core.TestContext
)

func init() {
	err := error(nil)
	if err = godotenv.Load(); err != nil {
		if !errors.Is(err, os.ErrNotExist) {
			panic("Load dotenv failed.")
		}
	}
	suiteTestCtx = util.AutoConf()
	log.InitLogger(*suiteTestCtx.Logger())
}
func TestRandomFailPoint(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "RandomFailPoint Suite")
}
