Skip to content
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

client/http: fix the URI of GetRegionLabelRulesByIDs (#8490) #8493

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/http/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func (c *client) GetRegionLabelRulesByIDs(ctx context.Context, ruleIDs []string)
var labelRules []*LabelRule
err = c.request(ctx, newRequestInfo().
WithName(getRegionLabelRulesByIDsName).
WithURI(RegionLabelRules).
WithURI(RegionLabelRulesByIDs).
WithMethod(http.MethodGet).
WithBody(idsJSON).
WithResp(&labelRules))
Expand Down
8 changes: 8 additions & 0 deletions tests/integrations/client/http_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,19 @@
re.Equal(labelRule.ID, allLabelRules[1].ID)
re.Equal(labelRule.Labels, allLabelRules[1].Labels)
re.Equal(labelRule.RuleType, allLabelRules[1].RuleType)
<<<<<<< HEAD

Check failure on line 454 in tests/integrations/client/http_client_test.go

View workflow job for this annotation

GitHub Actions / statics

expected statement, found '<<'
labelRules, err = client.GetRegionLabelRulesByIDs(env.ctx, []string{"keyspaces/0", "rule2"})
=======
labelRules, err = client.GetRegionLabelRulesByIDs(ctx, []string{"rule2"})
re.NoError(err)
re.Len(labelRules, 1)
re.Equal(labelRule, labelRules[0])
labelRules, err = client.GetRegionLabelRulesByIDs(ctx, []string{"keyspaces/0", "rule2"})
>>>>>>> 838ee7983 (client/http: fix the URI of GetRegionLabelRulesByIDs (#8490))

Check failure on line 462 in tests/integrations/client/http_client_test.go

View workflow job for this annotation

GitHub Actions / statics

exponent has no digits

Check failure on line 462 in tests/integrations/client/http_client_test.go

View workflow job for this annotation

GitHub Actions / statics

illegal character U+0023 '#'
re.NoError(err)
sort.Slice(labelRules, func(i, j int) bool {
return labelRules[i].ID < labelRules[j].ID
})

Check failure on line 466 in tests/integrations/client/http_client_test.go

View workflow job for this annotation

GitHub Actions / statics

expected declaration, found ')'
re.Equal(allLabelRules, labelRules)
}

Expand Down Expand Up @@ -742,7 +750,7 @@
c := pd.NewClientWithServiceDiscovery("pd-http-client-it", sd, pd.WithHTTPClient(httpClient), pd.WithMetrics(metricCnt, nil))
c.CreateScheduler(context.Background(), "test", 0)
var out dto.Metric
failureCnt, err := metricCnt.GetMetricWithLabelValues([]string{"CreateScheduler", "network error"}...)

Check failure on line 753 in tests/integrations/client/http_client_test.go

View workflow job for this annotation

GitHub Actions / statics

expected declaration, found failureCnt
re.NoError(err)
failureCnt.Write(&out)
re.Equal(float64(2), out.Counter.GetValue())
Expand Down
Loading