Skip to content

Commit 4fb675a

Browse files
authored
Merge pull request #9 from ZPascal/fix-integrationtest
Fix integrationtest
2 parents e479ade + cc04d09 commit 4fb675a

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

.github/workflows/integrationtest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ jobs:
2323
GRAFANA_HOST: ${{ secrets.GRAFANA_HOST }}
2424
GRAFANA_TOKEN: ${{ secrets.GRAFANA_TOKEN }}
2525
GRAFANA_DASHBOARD_PATH: ${{ secrets.GRAFANA_DASHBOARD_PATH }}
26-
GRAFANA_DASHBOARD_NAME: ${{ secrets.GRAFANA_DASHBOARD_NAME }}
26+
GRAFANA_DASHBOARD_NAME: ${{ secrets.GRAFANA_DASHBOARD_NAME }}
27+
GRAFANA_USERNAME: ${{ secrets.GRAFANA_USERNAME }}
28+
GRAFANA_PASSWORD: ${{ secrets.GRAFANA_PASSWORD }}

tests/integrationtest/test_alerting.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,10 @@ def test_get_prometheus_alerts(self):
119119
"data": {
120120
"alerts": [
121121
{
122-
"labels": {
123-
"__alert_rule_namespace_uid__": "6U_QdWJnz",
124-
"__alert_rule_uid__": "Z9GoLXx7z",
125-
"alertname": "Test",
126-
},
122+
"labels": {'alertname': 'Test'},
127123
"annotations": {},
128124
"state": "Normal",
129-
"activeAt": "0001-01-01T00:53:28+00:53",
125+
"activeAt": "0001-01-01T00:00:00Z",
130126
"value": "",
131127
}
132128
]

tests/integrationtest/test_organisation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ def test_get_all_users_by_the_current_organization(self):
2424
self.organisation.get_all_users_by_the_current_organization()
2525
)
2626

27-
self.assertEqual(4, organisation_users[0].get("userId"))
27+
self.assertEqual(4, organisation_users[1].get("userId"))
2828

2929
def test_get_all_users_by_the_current_organization_lookup(self):
3030
organisation_users: list = (
3131
self.organisation.get_all_users_by_the_current_organization_lookup()
3232
)
3333

34-
self.assertEqual(4, organisation_users[0].get("userId"))
34+
self.assertEqual(4, organisation_users[1].get("userId"))
3535

3636
def test_a_update_current_organization(self):
3737
self.organisation.update_current_organization("Test")
@@ -53,21 +53,21 @@ def test_a_add_new_user_to_current_organization(self):
5353
organisation_users: list = (
5454
self.organisation.get_all_users_by_the_current_organization_lookup()
5555
)
56-
self.assertEqual("Test", organisation_users[0].get("login"))
56+
self.assertEqual("Test", organisation_users[1].get("login"))
5757

5858
def test_b_update_organization_user_role_by_user_id(self):
5959
self.organisation.update_organization_user_role_by_user_id(7, "Editor")
6060

6161
organisation_users: list = (
6262
self.organisation.get_all_users_by_the_current_organization()
6363
)
64-
self.assertEqual(7, organisation_users[0].get("userId"))
65-
self.assertEqual("Editor", organisation_users[0].get("role"))
64+
self.assertEqual(7, organisation_users[1].get("userId"))
65+
self.assertEqual("Editor", organisation_users[1].get("role"))
6666

6767
def test_c_delete_organization_user_by_user_id(self):
6868
self.organisation.delete_organization_user_by_user_id(7)
6969

7070
organisation_users: list = (
7171
self.organisation.get_all_users_by_the_current_organization()
7272
)
73-
self.assertEqual(2, len(organisation_users))
73+
self.assertEqual(3, len(organisation_users))

tests/integrationtest/test_snapshot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import json
32
from unittest import TestCase
43

54
from src.grafana_api.model import APIModel

0 commit comments

Comments
 (0)