Skip to content

Commit

Permalink
Merge branch 'schedule_by_peer' of https://github.com/Yisaer/pd into …
Browse files Browse the repository at this point in the history
…schedule_by_peer
  • Loading branch information
Yisaer committed May 11, 2021
2 parents 23819a9 + 5f77deb commit ad07e97
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 43 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ test-with-cover: install-go-tools dashboard-ui
done
@$(FAILPOINT_DISABLE)

check: install-go-tools check-all check-plugin errdoc check-missing-tests docker-build-test
check: install-go-tools check-all check-plugin errdoc check-testing-t docker-build-test

check-all: static lint tidy
@echo "checking"
Expand Down Expand Up @@ -200,8 +200,8 @@ docker-build-test:
fi
docker build --no-cache -t tikv/pd .

check-missing-tests:
./scripts/check-missing-tests.sh
check-testing-t:
./scripts/check-testing-t.sh

simulator: export GO111MODULE=on
simulator:
Expand Down
5 changes: 0 additions & 5 deletions pkg/autoscaling/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"net/http"
"net/url"
"strings"
"testing"
"time"

. "github.com/pingcap/check"
Expand All @@ -41,10 +40,6 @@ const (
instanceCount = 3
)

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

var _ = Suite(&testPrometheusQuerierSuite{})

var podNameTemplate = map[ComponentType]string{
Expand Down
5 changes: 0 additions & 5 deletions pkg/encryption/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@
package encryption

import (
"testing"
"time"

. "github.com/pingcap/check"
"github.com/tikv/pd/pkg/typeutil"
)

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

type testConfigSuite struct{}

var _ = Suite(&testConfigSuite{})
Expand Down
2 changes: 1 addition & 1 deletion pkg/encryption/crypter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/pingcap/kvproto/pkg/encryptionpb"
)

func TestCrypter(t *testing.T) {
func Test(t *testing.T) {
TestingT(t)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/encryption/master_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ package encryption
import (
"encoding/hex"
"io/ioutil"
"testing"

. "github.com/pingcap/check"
"github.com/pingcap/kvproto/pkg/encryptionpb"
)

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

type testMasterKeySuite struct{}

var _ = Suite(&testMasterKeySuite{})
Expand Down
5 changes: 0 additions & 5 deletions pkg/encryption/region_crypter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@ package encryption
import (
"crypto/aes"
"crypto/cipher"
"testing"

. "github.com/pingcap/check"
"github.com/pingcap/errors"
"github.com/pingcap/kvproto/pkg/encryptionpb"
"github.com/pingcap/kvproto/pkg/metapb"
)

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

type testRegionCrypterSuite struct{}

var _ = Suite(&testRegionCrypterSuite{})
Expand Down
2 changes: 1 addition & 1 deletion pkg/typeutil/comparison_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
. "github.com/pingcap/check"
)

func TestComparison(t *testing.T) {
func TestTypeUtil(t *testing.T) {
TestingT(t)
}

Expand Down
6 changes: 0 additions & 6 deletions pkg/typeutil/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@
package typeutil

import (
"testing"

. "github.com/pingcap/check"
)

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

var _ = Suite(&testUint64BytesSuite{})

type testUint64BytesSuite struct{}
Expand Down
5 changes: 0 additions & 5 deletions pkg/typeutil/size_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@ package typeutil

import (
"encoding/json"
"testing"

. "github.com/pingcap/check"
)

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

var _ = Suite(&testSizeSuite{})

type testSizeSuite struct {
Expand Down
10 changes: 10 additions & 0 deletions scripts/check-missing-tests.sh → scripts/check-testing-t.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,14 @@ if [ "$res" ]; then
exit 1
fi

# Check if there are duplicated `TestingT` in package.

res=$(grep -r --include=\*_test.go "TestingT(" . | cut -f1 | xargs -L 1 dirname | sort | uniq -d)

if [ "$res" ]; then
echo "following packages may have duplicated TestingT:"
echo "$res"
exit 1
fi

exit 0
2 changes: 1 addition & 1 deletion tools/pd-analysis/analysis/parse_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
. "github.com/pingcap/check"
)

func TestParser(t *testing.T) {
func Test(t *testing.T) {
TestingT(t)
}

Expand Down
6 changes: 0 additions & 6 deletions tools/pd-analysis/analysis/transfer_counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@
package analysis

import (
"testing"

. "github.com/pingcap/check"
)

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

var _ = Suite(&testTransferRegionCounter{})

type testTransferRegionCounter struct{}
Expand Down

0 comments on commit ad07e97

Please sign in to comment.