Skip to content

Commit

Permalink
Merge branch 'master' into issue-28176
Browse files Browse the repository at this point in the history
  • Loading branch information
tisonkun authored Nov 13, 2021
2 parents 2ac2c49 + 4eb5172 commit e6ef838
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 122 deletions.
24 changes: 9 additions & 15 deletions br/pkg/version/build/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,22 @@ import (
"strings"
"testing"

. "github.com/pingcap/check"
"github.com/stretchr/testify/require"
)

type infoSuite struct{}
func TestInfo(t *testing.T) {
t.Parallel()

var _ = Suite(&infoSuite{})

func TestT(t *testing.T) {
TestingT(t)
}

func (*infoSuite) TestInfo(c *C) {
info := Info()
lines := strings.Split(info, "\n")
c.Assert(lines[0], Matches, "Release Version.*")
c.Assert(lines[1], Matches, "Git Commit Hash.*")
c.Assert(lines[2], Matches, "Git Branch.*")
c.Assert(lines[3], Matches, "Go Version.*")
c.Assert(lines[4], Matches, "UTC Build Time.*")
require.Regexp(t, "Release Version.*", lines[0])
require.Regexp(t, "Git Commit Hash.*", lines[1])
require.Regexp(t, "Git Branch.*", lines[2])
require.Regexp(t, "Go Version.*", lines[3])
require.Regexp(t, "UTC Build Time.*", lines[4])
}

func (*infoSuite) TestLogInfo(c *C) {
func TestLogInfo(t *testing.T) {
LogInfo(BR)
LogInfo(Lightning)
}
Loading

0 comments on commit e6ef838

Please sign in to comment.