diff --git a/pkg/metrics/observers/gloo_test.go b/pkg/metrics/observers/gloo_test.go index 830e3a7d1..7c413db7b 100644 --- a/pkg/metrics/observers/gloo_test.go +++ b/pkg/metrics/observers/gloo_test.go @@ -30,7 +30,7 @@ import ( ) func TestGlooObserver_GetRequestSuccessRate(t *testing.T) { - expected := ` sum( rate( envoy_cluster_upstream_rq{ envoy_cluster_name=~"default-podinfo-canary-[0-9a-zA-Z-]+_[0-9a-zA-Z-]+", envoy_response_code!~"5.*" }[1m] ) ) / sum( rate( envoy_cluster_upstream_rq{ envoy_cluster_name=~"default-podinfo-canary-[0-9a-zA-Z-]+_[0-9a-zA-Z-]+", }[1m] ) ) * 100` + expected := ` sum( rate( envoy_cluster_upstream_rq{ envoy_cluster_name=~"default-podinfo-canaryupstream-[0-9a-zA-Z-]+_[0-9a-zA-Z-]+", envoy_response_code!~"5.*" }[1m] ) ) / sum( rate( envoy_cluster_upstream_rq{ envoy_cluster_name=~"default-podinfo-canaryupstream-[0-9a-zA-Z-]+_[0-9a-zA-Z-]+", }[1m] ) ) * 100` ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { promql := r.URL.Query()["query"][0] @@ -64,7 +64,7 @@ func TestGlooObserver_GetRequestSuccessRate(t *testing.T) { } func TestGlooObserver_GetRequestDuration(t *testing.T) { - expected := ` histogram_quantile( 0.99, sum( rate( envoy_cluster_upstream_rq_time_bucket{ envoy_cluster_name=~"default-podinfo-canary-[0-9a-zA-Z-]+_[0-9a-zA-Z-]+", }[1m] ) ) by (le) )` + expected := ` histogram_quantile( 0.99, sum( rate( envoy_cluster_upstream_rq_time_bucket{ envoy_cluster_name=~"default-podinfo-canaryupstream-[0-9a-zA-Z-]+_[0-9a-zA-Z-]+", }[1m] ) ) by (le) )` ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { promql := r.URL.Query()["query"][0] diff --git a/pkg/router/gloo_test.go b/pkg/router/gloo_test.go index a62acdbdc..a6c321d5b 100644 --- a/pkg/router/gloo_test.go +++ b/pkg/router/gloo_test.go @@ -85,8 +85,17 @@ func TestGlooRouter_SetRoutes(t *testing.T) { glooClient: mocks.meshClient, kubeClient: mocks.kubeClient, } + svcRouter := &KubernetesDefaultRouter{ + kubeClient: mocks.kubeClient, + flaggerClient: mocks.flaggerClient, + logger: mocks.logger, + } + err := svcRouter.Initialize(mocks.canary) + require.NoError(t, err) + err = svcRouter.Reconcile(mocks.canary) + require.NoError(t, err) - err := router.Reconcile(mocks.canary) + err = router.Reconcile(mocks.canary) require.NoError(t, err) _, _, _, err = router.GetRoutes(mocks.canary) @@ -147,8 +156,17 @@ func TestGlooRouter_GetRoutes(t *testing.T) { glooClient: mocks.meshClient, kubeClient: mocks.kubeClient, } + svcRouter := &KubernetesDefaultRouter{ + kubeClient: mocks.kubeClient, + flaggerClient: mocks.flaggerClient, + logger: mocks.logger, + } + err := svcRouter.Initialize(mocks.canary) + require.NoError(t, err) + err = svcRouter.Reconcile(mocks.canary) + require.NoError(t, err) - err := router.Reconcile(mocks.canary) + err = router.Reconcile(mocks.canary) require.NoError(t, err) p, c, m, err := router.GetRoutes(mocks.canary)