Skip to content

Commit

Permalink
Merge branch 'master' into optimize_median
Browse files Browse the repository at this point in the history
  • Loading branch information
CabinfeverB committed Aug 2, 2023
2 parents fbe3df6 + 0c537bb commit a877eac
Show file tree
Hide file tree
Showing 497 changed files with 40,411 additions and 13,056 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/pd-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
- release-4.0
- release-5.*
- release-6.*
- release-7.*
pull_request:
branches:
- master
- release-4.0
- release-5.*
- release-6.*
- release-7.*
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
Expand All @@ -21,9 +23,9 @@ jobs:
strategy:
fail-fast: true
matrix:
worker_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
worker_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
outputs:
job-total: 10
job-total: 13
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -42,10 +44,10 @@ jobs:
- name: Make Test
env:
WORKER_ID: ${{ matrix.worker_id }}
WORKER_COUNT: 10
WORKER_COUNT: 13
JOB_COUNT: 10 # 11, 12 13 are for other integrations jobs
run: |
[ $WORKER_ID -ne $WORKER_COUNT ] && make ci-test-job JOB_COUNT=$(($WORKER_COUNT-1)) JOB_INDEX=$WORKER_ID
[ $WORKER_ID -eq $WORKER_COUNT ] && make ci-test-job-submod
make ci-test-job JOB_COUNT=$(($JOB_COUNT)) JOB_INDEX=$WORKER_ID
mv covprofile covprofile_$WORKER_ID
sed -i "/failpoint_binding/d" covprofile_$WORKER_ID
- name: Upload coverage result ${{ matrix.worker_id }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tso-function-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
- master
- release-5.*
- release-6.*
- release-7.*
pull_request:
branches:
- master
- release-5.*
- release-6.*
- release-7.*
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ report.xml
coverage.xml
coverage
*.txt
go.work*
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static: install-tools
@ echo "gofmt ..."
@ gofmt -s -l -d $(PACKAGE_DIRECTORIES) 2>&1 | awk '{ print } END { if (NR > 0) { exit 1 } }'
@ echo "golangci-lint ..."
@ golangci-lint run --verbose $(PACKAGE_DIRECTORIES)
@ golangci-lint run --verbose $(PACKAGE_DIRECTORIES) --allow-parallel-runners
@ echo "revive ..."
@ revive -formatter friendly -config revive.toml $(PACKAGES)

Expand Down Expand Up @@ -215,13 +215,11 @@ basic-test: install-tools

ci-test-job: install-tools dashboard-ui
@$(FAILPOINT_ENABLE)
CGO_ENABLED=1 go test -timeout=15m -tags deadlock -race -covermode=atomic -coverprofile=covprofile -coverpkg=./... $(shell ./scripts/ci-subtask.sh $(JOB_COUNT) $(JOB_INDEX))
@$(FAILPOINT_DISABLE)

ci-test-job-submod: install-tools dashboard-ui
@$(FAILPOINT_ENABLE)
@ for mod in $(SUBMODULES); do cd $$mod && $(MAKE) ci-test-job && cd $(ROOT_PATH) > /dev/null && cat $$mod/covprofile >> covprofile; done
@$(FAILPOINT_DISABLE)
if [[ $(JOB_INDEX) -le 10 ]]; then \
CGO_ENABLED=1 go test -timeout=15m -tags deadlock -race -covermode=atomic -coverprofile=covprofile -coverpkg=./... $(shell ./scripts/ci-subtask.sh $(JOB_COUNT) $(JOB_INDEX)); \
else \
for mod in $(shell ./scripts/ci-subtask.sh $(JOB_COUNT) $(JOB_INDEX)); do cd $$mod && $(MAKE) ci-test-job && cd $(ROOT_PATH) > /dev/null && cat $$mod/covprofile >> covprofile; done; \
fi

TSO_INTEGRATION_TEST_PKGS := $(PD_PKG)/tests/server/tso

Expand All @@ -244,7 +242,7 @@ test-tso-consistency: install-tools
TASK_COUNT=1
TASK_ID=1

# The command should be used in daily CIit will split some tasks to run parallel.
# The command should be used in daily CI, it will split some tasks to run parallel.
# It should retain report.xml,coverage,coverage.xml and package.list to analyze.
test-with-cover-parallel: install-tools dashboard-ui split
@$(FAILPOINT_ENABLE)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you're interested in contributing to PD, see [CONTRIBUTING.md](./CONTRIBUTING

## Build

1. Make sure [*Go*](https://golang.org/) (version 1.19) is installed.
1. Make sure [*Go*](https://golang.org/) (version 1.20) is installed.
2. Use `make` to install PD. PD is installed in the `bin` directory.

## Usage
Expand Down
13 changes: 8 additions & 5 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,24 @@ SHELL := env PATH='$(PATH)' GOBIN='$(GO_TOOLS_BIN_PATH)' $(shell which bash)
default: static tidy test

test:
CGO_ENABLE=1 go test -race -cover
CGO_ENABLE=1 go test ./... -race -cover

basic-test:
CGO_ENABLE=1 go test
CGO_ENABLE=1 go test ./...

ci-test-job:
CGO_ENABLED=1 go test -race -covermode=atomic -coverprofile=covprofile -coverpkg=../... github.com/tikv/pd/client
CGO_ENABLED=1 go test ./... -race -covermode=atomic -coverprofile=covprofile -coverpkg=../... github.com/tikv/pd/client

install-tools:
cd .. && $(MAKE) install-tools

static: install-tools
@ echo "gofmt ..."
@ gofmt -s -l -d . 2>&1 | awk '{ print } END { if (NR > 0) { exit 1 } }'
@ golangci-lint run -c ../.golangci.yml ./...
@ revive -formatter friendly -config ../revive.toml .
@ echo "golangci-lint ..."
@ golangci-lint run -c ../.golangci.yml --verbose ./... --allow-parallel-runners
@ echo "revive ..."
@ revive -formatter friendly -config ../revive.toml ./...

tidy:
@ go mod tidy
Expand Down
Loading

0 comments on commit a877eac

Please sign in to comment.