Skip to content

Commit f6feabf

Browse files
author
Anand S
committed
Update testing server and test cases
1 parent 9a94bab commit f6feabf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3838
- name: Test with pytest
3939
run: |
40-
PROM_URL="http://demo.robustperception.io:9090/" pytest
40+
PROM_URL="https://demo.promlabs.com/" pytest

tests/test_prometheus_connect.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TestPrometheusConnect(unittest.TestCase):
1717
def setUp(self):
1818
"""Set up connection settings for prometheus."""
1919
self.prometheus_host = os.getenv("PROM_URL")
20-
self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
20+
self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=False)
2121

2222
def test_metrics_list(self):
2323
"""Check if setup was done correctly."""
@@ -130,15 +130,15 @@ def test_get_metric_aggregation_with_incorrect_input_types(self): # noqa D102
130130

131131
def test_retry_on_error(self): # noqa D102
132132
retry = Retry(total=3, backoff_factor=0.1, status_forcelist=[400])
133-
pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True, retry=retry)
133+
pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=False, retry=retry)
134134

135135
with self.assertRaises(requests.exceptions.RetryError, msg="too many 400 error responses"):
136136
pc.custom_query("BOOM.BOOM!#$%")
137137

138138
def test_get_label_names_method(self): # noqa D102
139139
labels = self.pc.get_label_names(params={"match[]": "up"})
140-
self.assertEqual(len(labels), 4)
141-
self.assertEqual(labels, ["__name__", "env", "instance", "job"])
140+
self.assertEqual(len(labels), 3)
141+
self.assertEqual(labels, ["__name__", "instance", "job"])
142142

143143

144144
class TestPrometheusConnectWithMockedNetwork(BaseMockedNetworkTestcase):

0 commit comments

Comments
 (0)