From 2f0c5a280364f299ebeee0d7fdec33024fbaf7a9 Mon Sep 17 00:00:00 2001
From: Varac <varac@varac.net>
Date: Tue, 19 Oct 2021 14:10:25 +0200
Subject: [PATCH] Ignore nextcloud-cron failures in CI

---
 test/pytest/test_prometheus.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/test/pytest/test_prometheus.py b/test/pytest/test_prometheus.py
index f64fc4e2b..4ae44b824 100755
--- a/test/pytest/test_prometheus.py
+++ b/test/pytest/test_prometheus.py
@@ -2,12 +2,12 @@
 Test that alertmanager fires no alerts, except for a few ignored by
 `ignore_alert`.
 """
-import re
 import json
 import os
-import requests
+import re
 
 import pytest
+import requests
 
 
 def ignore_alert(alert):
@@ -20,10 +20,12 @@ def ignore_alert(alert):
     if alert["labels"]["severity"] == "none":
         return True
 
-    # Ignore `KubeAPILatencyHigh` fom high load during installation
-    # phase
+    # Ignore issues fom high load during installation phase
     if re.search(r"(KubeAPIDown|KubeletDown|NodeFilesystemSpaceFillingUp)",
-            alert["labels"]["alertname"]):
+        alert["labels"]["alertname"]):
+        return True
+    # Ignore nextcloud cron jobs (https://open.greenhost.net/openappstack/openappstack/-/issues/984)
+    if re.search(r"nc-nextcloud-cron", alert["annotations"]["description"]):
         return True
 
     return False
-- 
GitLab