package tests

import (
	"testing"
	"time"

	sentrygo "github.com/getsentry/sentry-go"
	"github.com/pingcap/dbaas/billing2/config"
	"github.com/pingcap/dbaas/billing2/utils/log"
	"github.com/pingcap/dbaas/billing2/utils/sentry"
	"github.com/pingcap/dbaas/billing2/utils/tests"
	"github.com/stretchr/testify/suite"
)

type SentryTestSuite struct {
	tests.BillingTestSuite
}

func TestSentrySuite(t *testing.T) {
	suite.Run(t, new(SentryTestSuite))
}

func (s *SentryTestSuite) TestSendSentry() {
	s.T().Skip()
	assert := s.Assert()
	config.Get().Set(config.EnableSentryLog, true)
	config.Get().Set(config.SentryServerEnv, "test")
	config.Get().Set(config.SentryServerDSN, "test_sentry_dsn")
	err := sentry.SetupLoggerAndSentry()
	assert.NoError(err)
	defer sentrygo.Flush(2 * time.Second)

	log.Error("send a new sentry event")
}
