Skip to content

Commit

Permalink
Fix running of auth tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed May 21, 2021
1 parent f5c77b7 commit afddeb0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
package auth

import (
"testing"

. "github.com/pingcap/check"
)

Expand All @@ -22,6 +24,10 @@ var _ = Suite(&testAuthSuite{})
type testAuthSuite struct {
}

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

func (s *testAuthSuite) TestEncodePassword(c *C) {
pwd := "123"
c.Assert(EncodePassword(pwd), Equals, "*23AE809DDACAF96AF0FD78ED04B6A265E05AA257")
Expand Down
14 changes: 14 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
#!/bin/sh

# If 'check.TestingT' is not used in any of the *_test.go files in a subdir no tests will run.

for f in $(git grep -l 'github.com/pingcap/check' | grep '/' | cut -d/ -f1 | uniq)
do
grep -r TestingT $f > /dev/null
if [[ $? -ne 0 ]]
then
echo "check.TestingT missing from $f"
exit 1
fi
done

GO111MODULE=on go test -p 1 -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=./... ./...

0 comments on commit afddeb0

Please sign in to comment.