prometheus-api-client-python
prometheus-api-client-python copied to clipboard
Most of the tests are failing when packaging this for openSUSE: Failing due to missing network connectivity?
Describe the bug I am trying to package this for openSUSE, but many tests are failing.
The build is running in a build environment without internet connectivity. All of the required dependencies should be present.
I just want to be sure that all of them are failing due to a missing prometheus instance, or rather missing connectivity to http://demo.robustperception.io:9090/
These are the failing tests, the detailled log is below:
[ 39s] =========================== short test summary info ============================
[ 39s] FAILED tests/test_metric.py::TestMetric::test_init - IndexError: list index o...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_addition - IndexError: l...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_end_time - IndexError: l...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_equality - IndexError: l...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_start_time - IndexError:...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_oldest_data_datetime_with_datetime
[ 39s] FAILED tests/test_metric.py::TestMetric::test_oldest_data_datetime_with_timedelta
[ 39s] FAILED tests/test_metric.py::TestMetric::test_setup - AssertionError: 8 != 0 ...
[ 39s] FAILED tests/test_metric_range_df.py::TestMetricRangeDataFrame::test_init_single_metric
[ 39s] FAILED tests/test_metric_range_df.py::TestMetricRangeDataFrame::test_setup - ...
[ 39s] FAILED tests/test_metric_snapshot_df.py::TestMetricSnapshotDataFrame::test_init_single_metric
[ 39s] FAILED tests/test_metric_snapshot_df.py::TestMetricSnapshotDataFrame::test_setup
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_init - AssertionErro...
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_init_single_metric
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_setup - AssertionErr...
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_unique_metric_combination
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_label_names_method
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_aggregation
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_aggregation_with_incorrect_input_types
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_range_data
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_range_data_with_chunk_size
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_range_data_with_incorrect_input_types
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_metrics_list
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_retry_on_error
[ 39s] ======================== 24 failed, 20 passed in 0.81s =========================
To Reproduce
- A new VM is being installed, with all dependencies preinstalled.
- The package is built using pip/wheel/setuptools.
- For each of the python versions the corresponding pytest call is made.
- Some of the tests fail.
Log output
[ 39s] =================================== FAILURES ===================================
[ 39s] _____________________________ TestMetric.test_init _____________________________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_init>
[ 39s]
[ 39s] def test_init(self): # noqa D102
[ 39s] > test_metric_object = Metric(self.raw_metrics_list[0][0])
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric.py:20: IndexError
[ 39s] _______________________ TestMetric.test_metric_addition ________________________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_metric_addition>
[ 39s]
[ 39s] def test_metric_addition(self): # noqa D102
[ 39s] with self.assertRaises(TypeError, msg="incorrect addition of two metrics"):
[ 39s] > _ = Metric(self.raw_metrics_list[0][0]) + Metric(self.raw_metrics_list[0][1])
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric.py:57: IndexError
[ 39s] _______________________ TestMetric.test_metric_end_time ________________________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_metric_end_time>
[ 39s]
[ 39s] def test_metric_end_time(self): # noqa D102
[ 39s] end_time = datetime.datetime(2019, 7, 28, 16, 00)
[ 39s] end_time_minus_1m = datetime.datetime(2019, 7, 28, 15, 59)
[ 39s]
[ 39s] > test_metric_object = Metric(self.raw_metrics_list[0][0])
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric.py:37: IndexError
[ 39s] _______________________ TestMetric.test_metric_equality ________________________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_metric_equality>
[ 39s]
[ 39s] def test_metric_equality(self): # noqa D102
[ 39s] self.assertEqual(
[ 39s] > Metric(self.raw_metrics_list[0][0]),
[ 39s] Metric(self.raw_metrics_list[1][0]),
[ 39s] "incorrect inequality",
[ 39s] )
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric.py:45: IndexError
[ 39s] ______________________ TestMetric.test_metric_start_time _______________________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_metric_start_time>
[ 39s]
[ 39s] def test_metric_start_time(self): # noqa D102
[ 39s] start_time = datetime.datetime(2019, 7, 28, 10, 0)
[ 39s] start_time_plus_1m = datetime.datetime(2019, 7, 28, 10, 1)
[ 39s]
[ 39s] > test_metric_object = Metric(self.raw_metrics_list[0][0])
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric.py:27: IndexError
[ 39s] ______________ TestMetric.test_oldest_data_datetime_with_datetime ______________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_oldest_data_datetime_with_datetime>
[ 39s]
[ 39s] def test_oldest_data_datetime_with_datetime(self): # noqa D102
[ 39s] with self.assertRaises(TypeError, msg="incorrect parameter type accepted"):
[ 39s] > _ = Metric(self.raw_metrics_list[0][0], oldest_data_datetime="2d")
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric.py:74: IndexError
[ 39s] _____________ TestMetric.test_oldest_data_datetime_with_timedelta ______________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_oldest_data_datetime_with_timedelta>
[ 39s]
[ 39s] def test_oldest_data_datetime_with_timedelta(self): # noqa D102
[ 39s] > expected_start_time = Metric(self.raw_metrics_list[0][0]).metric_values.iloc[4, 0]
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric.py:91: IndexError
[ 39s] ____________________________ TestMetric.test_setup _____________________________
[ 39s]
[ 39s] self = <tests.test_metric.TestMetric testMethod=test_setup>
[ 39s]
[ 39s] def test_setup(self):
[ 39s] """Check if setup was done correctly."""
[ 39s] > self.assertEqual(8, len(self.raw_metrics_list), "incorrect number json files read")
[ 39s] E AssertionError: 8 != 0 : incorrect number json files read
[ 39s]
[ 39s] tests/test_with_metrics.py:33: AssertionError
[ 39s] _______________ TestMetricRangeDataFrame.test_init_single_metric _______________
[ 39s]
[ 39s] self = <tests.test_metric_range_df.TestMetricRangeDataFrame testMethod=test_init_single_metric>
[ 39s]
[ 39s] def test_init_single_metric(self):
[ 39s] """
[ 39s] Test if dataframe initialized is of correct shape.
[ 39s]
[ 39s] 1. json object is passed as data
[ 39s] 2. list with single json object is passed as data
[ 39s] """
[ 39s] # check shape when single json passed
[ 39s] > num_vals = len(self.raw_metrics_list[0][0]["values"])
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric_range_df.py:83: IndexError
[ 39s] _____________________ TestMetricRangeDataFrame.test_setup ______________________
[ 39s]
[ 39s] self = <tests.test_metric_range_df.TestMetricRangeDataFrame testMethod=test_setup>
[ 39s]
[ 39s] def test_setup(self):
[ 39s] """Check if setup was done correctly."""
[ 39s] > self.assertEqual(
[ 39s] 8, len(self.raw_metrics_list), "incorrect number json files read (incorrect test setup)"
[ 39s] )
[ 39s] E AssertionError: 8 != 0 : incorrect number json files read (incorrect test setup)
[ 39s]
[ 39s] tests/test_metric_range_df.py:18: AssertionError
[ 39s] _____________ TestMetricSnapshotDataFrame.test_init_single_metric ______________
[ 39s]
[ 39s] self = <tests.test_metric_snapshot_df.TestMetricSnapshotDataFrame testMethod=test_init_single_metric>
[ 39s]
[ 39s] def test_init_single_metric(self):
[ 39s] """
[ 39s] Test if dataframe initialized is of correct shape.
[ 39s]
[ 39s] 1. json object is passed as data
[ 39s] 2. list with single json object is passed as data
[ 39s] """
[ 39s] # check shape when single json passed
[ 39s] self.assertEqual(
[ 39s] (1, 6),
[ 39s] > MetricSnapshotDataFrame(self.raw_metrics_list[0][0]).shape,
[ 39s] "incorrect dataframe shape when initialized with json",
[ 39s] )
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metric_snapshot_df.py:87: IndexError
[ 39s] ____________________ TestMetricSnapshotDataFrame.test_setup ____________________
[ 39s]
[ 39s] self = <tests.test_metric_snapshot_df.TestMetricSnapshotDataFrame testMethod=test_setup>
[ 39s]
[ 39s] def test_setup(self):
[ 39s] """Check if setup was done correctly."""
[ 39s] > self.assertEqual(
[ 39s] 8, len(self.raw_metrics_list), "incorrect number json files read (incorrect test setup)"
[ 39s] )
[ 39s] E AssertionError: 8 != 0 : incorrect number json files read (incorrect test setup)
[ 39s]
[ 39s] tests/test_metric_snapshot_df.py:34: AssertionError
[ 39s] __________________________ TestMetricsList.test_init ___________________________
[ 39s]
[ 39s] self = <tests.test_metrics_list.TestMetricsList testMethod=test_init>
[ 39s]
[ 39s] def test_init(self):
[ 39s] """Test if metrics initialized in the list are correct."""
[ 39s] > self.assertEqual(
[ 39s] 9, # manually check the number of unique metric time-series
[ 39s] len(MetricsList(self.raw_metrics_list)),
[ 39s] "incorrect number of unique metric timeseries",
[ 39s] )
[ 39s] E AssertionError: 9 != 0 : incorrect number of unique metric timeseries
[ 39s]
[ 39s] tests/test_metrics_list.py:17: AssertionError
[ 39s] ___________________ TestMetricsList.test_init_single_metric ____________________
[ 39s]
[ 39s] self = <tests.test_metrics_list.TestMetricsList testMethod=test_init_single_metric>
[ 39s]
[ 39s] def test_init_single_metric(self): # noqa D102
[ 39s] self.assertEqual(
[ 39s] 1,
[ 39s] > len(MetricsList(self.raw_metrics_list[0][0])),
[ 39s] "incorrect number of Metric objects initialized for a raw metric not in a list",
[ 39s] )
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metrics_list.py:26: IndexError
[ 39s] __________________________ TestMetricsList.test_setup __________________________
[ 39s]
[ 39s] self = <tests.test_metrics_list.TestMetricsList testMethod=test_setup>
[ 39s]
[ 39s] def test_setup(self):
[ 39s] """Check if setup was done correctly."""
[ 39s] > self.assertEqual(8, len(self.raw_metrics_list), "incorrect number json files read")
[ 39s] E AssertionError: 8 != 0 : incorrect number json files read
[ 39s]
[ 39s] tests/test_with_metrics.py:33: AssertionError
[ 39s] ________________ TestMetricsList.test_unique_metric_combination ________________
[ 39s]
[ 39s] self = <tests.test_metrics_list.TestMetricsList testMethod=test_unique_metric_combination>
[ 39s]
[ 39s] def test_unique_metric_combination(self): # noqa D102
[ 39s] start_time = datetime.datetime(2019, 7, 28, 10, 0)
[ 39s] start_time_plus_1m = datetime.datetime(2019, 7, 28, 10, 1)
[ 39s] end_time = datetime.datetime(2019, 7, 30, 10, 0)
[ 39s] end_time_minus_1m = datetime.datetime(2019, 7, 30, 9, 59)
[ 39s]
[ 39s] self.assertTrue(
[ 39s] > MetricsList(self.raw_metrics_list)[0].start_time > start_time,
[ 39s] "Combined metric start time incorrect",
[ 39s] )
[ 39s] E IndexError: list index out of range
[ 39s]
[ 39s] tests/test_metrics_list.py:42: IndexError
[ 39s] ______________ TestPrometheusConnect.test_get_label_names_method _______________
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_get_label_names_method>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa19669a0>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] ______________ TestPrometheusConnect.test_get_metric_aggregation _______________
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_get_metric_aggregation>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [196/2062]
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa5d7b190>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] _ TestPrometheusConnect.test_get_metric_aggregation_with_incorrect_input_types _
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_get_metric_aggregation_with_incorrect_input_types>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa189a7f0>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] _______________ TestPrometheusConnect.test_get_metric_range_data _______________ [144/2062]
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_get_metric_range_data>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa18f93d0>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] _______ TestPrometheusConnect.test_get_metric_range_data_with_chunk_size _______
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_get_metric_range_data_with_chunk_size>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa17ef400>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] _ TestPrometheusConnect.test_get_metric_range_data_with_incorrect_input_types __
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_get_metric_range_data_with_incorrect_input_types>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa183a670>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] ___________________ TestPrometheusConnect.test_metrics_list ____________________
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_metrics_list>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa1892e80>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] __________________ TestPrometheusConnect.test_retry_on_error ___________________
[ 39s]
[ 39s] self = <tests.test_prometheus_connect.TestPrometheusConnect testMethod=test_retry_on_error>
[ 39s]
[ 39s] def setUp(self):
[ 39s] """Set up connection settings for prometheus."""
[ 39s] self.prometheus_host = os.getenv("PROM_URL")
[ 39s] > self.pc = PrometheusConnect(url=self.prometheus_host, disable_ssl=True)
[ 39s]
[ 39s] tests/test_prometheus_connect.py:20:
[ 39s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 39s]
[ 39s] self = <prometheus_api_client.prometheus_connect.PrometheusConnect object at 0x7fdfa1848340>
[ 39s] url = None, headers = None, disable_ssl = True, retry = None, auth = None
[ 39s] proxy = None
[ 39s]
[ 39s] def __init__(
[ 39s] self,
[ 39s] url: str = "http://127.0.0.1:9090",
[ 39s] headers: dict = None,
[ 39s] disable_ssl: bool = False,
[ 39s] retry: Retry = None,
[ 39s] auth: tuple = None,
[ 39s] proxy: dict = None
[ 39s] ):
[ 39s] """Functions as a Constructor for the class PrometheusConnect."""
[ 39s] if url is None:
[ 39s] > raise TypeError("missing url")
[ 39s] E TypeError: missing url
[ 39s]
[ 39s] prometheus_api_client/prometheus_connect.py:54: TypeError
[ 39s] =========================== short test summary info ============================
[ 39s] FAILED tests/test_metric.py::TestMetric::test_init - IndexError: list index o...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_addition - IndexError: l...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_end_time - IndexError: l...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_equality - IndexError: l...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_metric_start_time - IndexError:...
[ 39s] FAILED tests/test_metric.py::TestMetric::test_oldest_data_datetime_with_datetime
[ 39s] FAILED tests/test_metric.py::TestMetric::test_oldest_data_datetime_with_timedelta
[ 39s] FAILED tests/test_metric.py::TestMetric::test_setup - AssertionError: 8 != 0 ...
[ 39s] FAILED tests/test_metric_range_df.py::TestMetricRangeDataFrame::test_init_single_metric
[ 39s] FAILED tests/test_metric_range_df.py::TestMetricRangeDataFrame::test_setup - ...
[ 39s] FAILED tests/test_metric_snapshot_df.py::TestMetricSnapshotDataFrame::test_init_single_metric
[ 39s] FAILED tests/test_metric_snapshot_df.py::TestMetricSnapshotDataFrame::test_setup
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_init - AssertionErro...
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_init_single_metric
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_setup - AssertionErr...
[ 39s] FAILED tests/test_metrics_list.py::TestMetricsList::test_unique_metric_combination
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_label_names_method
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_aggregation
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_aggregation_with_incorrect_input_types
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_range_data
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_range_data_with_chunk_size
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_get_metric_range_data_with_incorrect_input_types
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_metrics_list
[ 39s] FAILED tests/test_prometheus_connect.py::TestPrometheusConnect::test_retry_on_error
[ 39s] ======================== 24 failed, 20 passed in 0.81s =========================