Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp committed Jul 10, 2023
1 parent 906850b commit 8da8967
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
6 changes: 3 additions & 3 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ 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
Expand Down
10 changes: 9 additions & 1 deletion client/resource_group/controller/limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,19 @@ func TestReconfig(t *testing.T) {
args := tokenBucketReconfigureArgs{
NewTokens: 6.,
NewRate: 2,
NewBurst: -1,
}
lim.Reconfigure(t1, args)
checkTokens(re, lim, t1, 5)
checkTokens(re, lim, t2, 7)

args = tokenBucketReconfigureArgs{
NewTokens: 6.,
NewRate: 2,
NewBurst: -1,
}
lim.Reconfigure(t1, args)
checkTokens(re, lim, t1, 6)
checkTokens(re, lim, t2, 6)
re.Equal(int64(-1), lim.GetBurst())
}

Expand Down
20 changes: 0 additions & 20 deletions client/resource_group/controller/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ func TestGetRUValueFromConsumption(t *testing.T) {

result = getRUValueFromConsumption(custom, typ)
re.Equal(expected, result)

// When typ is not RU
custom = &rmpb.Consumption{RRU: 2.5, WRU: 3.5}
typ = rmpb.RequestUnitType_RU
expected = float64(0)

result = getRUValueFromConsumption(custom, typ)
re.Equal(expected, result)
}

func TestGetRUTokenBucketSetting(t *testing.T) {
Expand All @@ -69,18 +61,6 @@ func TestGetRUTokenBucketSetting(t *testing.T) {
if result != expected {
t.Errorf("Expected nil but got %v", result)
}

// When typ is not RU
group = &rmpb.ResourceGroup{
RUSettings: &rmpb.GroupRequestUnitSettings{
RU: &rmpb.TokenBucket{Settings: &rmpb.TokenLimitSettings{FillRate: 100}},
},
}
typ = rmpb.RequestUnitType_RU
expected = nil

result = getRUTokenBucketSetting(group, typ)
re.Equal(expected, result)
}

func TestGetRawResourceValueFromConsumption(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions tests/integrations/tso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ tidy:
git diff --quiet go.mod go.sum

test: failpoint-enable
CGO_ENABLED=1 go test -v -tags deadlock -race -cover || { $(MAKE) failpoint-disable && exit 1; }
CGO_ENABLED=1 go test ./... -v -tags deadlock -race -cover || { $(MAKE) failpoint-disable && exit 1; }
$(MAKE) failpoint-disable

ci-test-job:
CGO_ENABLED=1 go test -v -tags deadlock -race -covermode=atomic -coverprofile=covprofile -coverpkg=$(ROOT_PATH)/... github.com/tikv/pd/tests/integrations/tso
CGO_ENABLED=1 go test ./... -v -tags deadlock -race -covermode=atomic -coverprofile=covprofile -coverpkg=$(ROOT_PATH)/... github.com/tikv/pd/tests/integrations/tso

install-tools:
cd $(ROOT_PATH) && $(MAKE) install-tools
Expand Down

0 comments on commit 8da8967

Please sign in to comment.