Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix running of auth tests #1227

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
13 changes: 13 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
#!/bin/sh

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Let's run this check in the make test of Makefile.


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

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