package e2e

import (
	"flag"
	"math/rand"
	"os"
	"testing"
	"time"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	// test cases
	_ "github.com/tidbcloud/clusterproxy/test/route"
)

func TestMain(m *testing.M) {
	rand.Seed(time.Now().UnixNano())
	os.Exit(m.Run())
}

func TestE2ESuite(t *testing.T) {
	if testing.Short() {
		t.Skip("Running unit tests... Skip the end-to-end tests.")
	}
	BeforeSuite(func() {
		flag.Parse()
	})

	RegisterFailHandler(Fail)
	RunSpecs(t, "Cluster Proxy End-to-end Test Suite")
}
