-
Notifications
You must be signed in to change notification settings - Fork 725
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
ci: support real cluster test in jenkins #7493
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a8985fb
use bin
HuSharp cc50140
fix test
HuSharp e240aa6
Merge branch 'master' into support_jenkins
HuSharp 75b36ff
remove redundant code
HuSharp f695316
merge master
HuSharp 6ddb0c9
make ci happy
HuSharp 57fa1a4
remove download
HuSharp c5555f2
Merge branch 'master' into support_jenkins
HuSharp 823c696
fmt
HuSharp e318d28
Merge branch 'master' into support_jenkins
HuSharp e296e7e
Merge branch 'master' into support_jenkins
HuSharp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,58 @@ | ||
# 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) | ||
|
||
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 | ||
|
||
check: deploy test kill_tiup | ||
|
||
deploy: kill_tiup | ||
@ echo "deploying..." | ||
./deploy.sh | ||
@ echo "wait tiup cluster ready..." | ||
./wait_tiup.sh 15 20 | ||
@ echo "check cluster status..." | ||
@ pid=$$(ps -ef | grep 'tiup' | grep -v grep | awk '{print $$2}' | head -n 1); \ | ||
echo $$pid; | ||
|
||
kill_tiup: | ||
@ echo "kill tiup..." | ||
@ pid=$$(ps -ef | grep 'tiup' | grep -v grep | awk '{print $$2}' | head -n 1); \ | ||
if [ ! -z "$$pid" ]; then \ | ||
echo $$pid; \ | ||
kill $$pid; \ | ||
echo "waiting for tiup to exit..."; \ | ||
sleep 10; \ | ||
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,23 @@ | ||
#!/bin/bash | ||
# deploy `tiup playground` | ||
|
||
TIUP_BIN_DIR=$HOME/.tiup/bin/tiup | ||
CUR_PATH=$(pwd) | ||
|
||
# See https://misc.flogisoft.com/bash/tip_colors_and_formatting. | ||
color-green() { # Green | ||
echo -e "\x1B[1;32m${*}\x1B[0m" | ||
} | ||
|
||
# Install TiUP | ||
color-green "install TiUP..." | ||
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh | ||
$TIUP_BIN_DIR update playground | ||
|
||
cd ../../.. | ||
# Run TiUP | ||
$TIUP_BIN_DIR playground nightly --kv 3 --tiflash 1 --db 1 --pd 3 --without-monitor \ | ||
HuSharp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--pd.binpath ./bin/pd-server --kv.binpath ./bin/tikv-server --db.binpath ./bin/tidb-server --tiflash.binpath ./bin/tiflash --tag pd_test \ | ||
> $CUR_PATH/playground.log 2>&1 & | ||
|
||
cd $CUR_PATH |
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/realtiup | ||
|
||
go 1.21 | ||
|
||
replace github.com/tikv/pd/client => ../../../client | ||
|
||
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/stretchr/testify v1.8.4 | ||
github.com/tikv/pd/client v0.0.0-00010101000000-000000000000 | ||
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/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // 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/goleak v1.1.12 // 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no tag in the ci environment, we can not pass
pd/server/util.go
Lines 39 to 41 in bfc988b