-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: husharp <[email protected]>
- Loading branch information
Showing
17 changed files
with
599 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright 2023 TiKV Project Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ROOT_PATH := ../../.. | ||
GO_TOOLS_BIN_PATH := $(ROOT_PATH)/.tools/bin | ||
PATH := $(GO_TOOLS_BIN_PATH):$(PATH) | ||
SHELL := env PATH='$(PATH)' GOBIN='$(GO_TOOLS_BIN_PATH)' $(shell which bash) | ||
|
||
check: deploy test clean | ||
|
||
static: install-tools | ||
@ echo "gofmt ..." | ||
@ gofmt -s -l -d . 2>&1 | awk '{ print } END { if (NR > 0) { exit 1 } }' | ||
@ echo "golangci-lint ..." | ||
@ golangci-lint run -c $(ROOT_PATH)/.golangci.yml --verbose ./... --allow-parallel-runners | ||
@ echo "revive ..." | ||
@ revive -formatter friendly -config $(ROOT_PATH)/revive.toml ./... | ||
|
||
tidy: | ||
@ go mod tidy | ||
git diff go.mod go.sum | cat | ||
git diff --quiet go.mod go.sum | ||
|
||
deploy: clean | ||
echo "deploying..." | ||
./deploy.sh | ||
echo "wait tiup cluster ready..." | ||
sleep 30 | ||
|
||
clean: | ||
pid=$$(ps -ef | grep 'tiup' | grep -v grep | awk '{print $$2}' | head -n 1); \ | ||
if [ ! -z "$$pid" ]; then \ | ||
echo $$pid; \ | ||
kill $$pid; \ | ||
fi | ||
|
||
test: | ||
CGO_ENABLED=1 go test ./... -v -tags deadlock -race -cover || { exit 1; } | ||
|
||
install-tools: | ||
cd $(ROOT_PATH) && $(MAKE) install-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2023 TiKV Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package real | ||
|
||
import ( | ||
flag "github.com/spf13/pflag" | ||
"github.com/stretchr/testify/suite" | ||
"testing" | ||
) | ||
|
||
var ( | ||
withTiKV = flag.Bool("with-tikv", false, "run tests with TiKV cluster started. (not use the mock server)") | ||
pdAddrs = flag.String("pd-addrs", "127.0.0.1:2379", "pd addrs") | ||
) | ||
|
||
func TestPDAPI(t *testing.T) { | ||
if !*withTiKV { | ||
t.Skip("skipping TestPDAPI because with-tikv is not enabled") | ||
} | ||
suite.Run(t, new(apiTestSuite)) | ||
} | ||
|
||
type apiTestSuite struct { | ||
suite.Suite | ||
} | ||
|
||
func (s *apiTestSuite) SetupTest() { | ||
//addrs := strings.Split(*pdAddrs, ",") | ||
//pdClient, err := pd.NewClient(addrs, pd.SecurityOption{}) | ||
|
||
} | ||
|
||
func (s *apiTestSuite) TestGetStoresMinResolvedTS() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
make clean | ||
cd ../../../ | ||
rm -rf bin | ||
make pd-server | ||
tiup playground nightly --kv 3 --tiflash 0 --db 3 --pd.binpath ./bin/pd-server > playground.log 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module github.com/tikv/pd/tests/integrations/real | ||
|
||
go 1.21 | ||
|
||
require ( | ||
github.com/DATA-DOG/go-sqlmock v1.5.0 | ||
github.com/go-sql-driver/mysql v1.7.1 | ||
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/stretchr/testify v1.8.4 | ||
github.com/tikv/pd/client v0.0.0-20231102093810-01fb56b4f1eb | ||
gorm.io/driver/mysql v1.5.2 | ||
gorm.io/gorm v1.25.5 | ||
moul.io/zapgorm2 v1.3.0 | ||
) | ||
|
||
require ( | ||
github.com/benbjohnson/clock v1.3.0 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/cespare/xxhash/v2 v2.2.0 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/jinzhu/inflection v1.0.0 // indirect | ||
github.com/jinzhu/now v1.1.5 // indirect | ||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect | ||
github.com/opentracing/opentracing-go v1.2.0 // indirect | ||
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect | ||
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00 // indirect | ||
github.com/pingcap/kvproto v0.0.0-20230727073445-53e1f8730c30 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/prometheus/client_golang v1.11.1 // indirect | ||
github.com/prometheus/client_model v0.2.0 // indirect | ||
github.com/prometheus/common v0.26.0 // indirect | ||
github.com/prometheus/procfs v0.6.0 // indirect | ||
go.uber.org/atomic v1.10.0 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
go.uber.org/zap v1.24.0 // indirect | ||
golang.org/x/net v0.17.0 // indirect | ||
golang.org/x/sys v0.13.0 // indirect | ||
golang.org/x/text v0.13.0 // indirect | ||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect | ||
google.golang.org/grpc v1.54.0 // indirect | ||
google.golang.org/protobuf v1.30.0 // indirect | ||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.