mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
fix tests
This commit is contained in:
parent
fa5f8cd742
commit
c0ae5d6dd4
1 changed files with 0 additions and 23 deletions
|
|
@ -83,14 +83,6 @@ func TestBuildSelector(t *testing.T) {
|
||||||
return mq
|
return mq
|
||||||
}
|
}
|
||||||
|
|
||||||
mustNewNonNamespacedQuery := func(queryTemplate string, namespaced bool) MetricsQuery {
|
|
||||||
mq, err := NewMetricsQuery(queryTemplate, &resourceConverterMock{namespaced}, false)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
return mq
|
|
||||||
}
|
|
||||||
|
|
||||||
mustNewLabelRequirement := func(key string, op selection.Operator, vals []string) *labels.Requirement {
|
mustNewLabelRequirement := func(key string, op selection.Operator, vals []string) *labels.Requirement {
|
||||||
req, err := labels.NewRequirement(key, op, vals)
|
req, err := labels.NewRequirement(key, op, vals)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -212,21 +204,6 @@ func TestBuildSelector(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
name: "multiple LabelValuesByName values with namespace disabled",
|
|
||||||
|
|
||||||
mq: mustNewNonNamespacedQuery(`<<index .LabelValuesByName "namespaces">> <<index .LabelValuesByName "resource">>`, true),
|
|
||||||
metricSelector: labels.NewSelector(),
|
|
||||||
resource: schema.GroupResource{Group: "group", Resource: "resource"},
|
|
||||||
namespace: "default",
|
|
||||||
names: []string{"bar", "baz"},
|
|
||||||
|
|
||||||
check: checks(
|
|
||||||
hasError(nil),
|
|
||||||
hasSelector(" bar|baz"),
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "single GroupBy value",
|
name: "single GroupBy value",
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue