Add e2e tests for Grafana deployment

Signed-off-by: Arthur Sens <arthursens2005@gmail.com>
This commit is contained in:
Arthur Silva Sens
2021-09-21 22:50:47 +00:00
committed by GitHub
parent 44466ff434
commit 9e83b3cbd0

View File

@@ -277,3 +277,18 @@ func TestFailedRuleEvaluations(t *testing.T) {
t.Fatal(err)
}
}
func TestGrafana(t *testing.T){
kClient := promClient.kubeClient
err := wait.Poll(30*time.Second, 5*time.Minute, func() (bool, error) {
grafanaDeployment, err := kClient.AppsV1().Deployments("monitoring").Get(context.Background(), "grafana", metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
return grafanaDeployment.Status.ReadyReplicas == *grafanaDeployment.Spec.Replicas, nil
})
if err != nil {
t.Fatal(errors.Wrap(err, "Timeout while waiting for deployment ready condition."))
}
}