From d656c191131e20bb634e4eeb6d074bc32a6df60f Mon Sep 17 00:00:00 2001 From: Hemanth Nakkina Date: Mon, 30 May 2022 11:31:15 +0530 Subject: [PATCH] Unblock the gate and update python testing This combines two commits in one * Change aggregation method to mean Commit 6061286c3133a4b85c4a72160960ecf6a82d02f8 handles ignoring gnocchi api error when metric is not created. However there are functional test failures when the aggregation method is set to last for alarm type gnocchi_aggregation_by_resources_threshold, This fix changes the aggregration method to mean for any create/update of alarm type gnocchi_aggregation_by_resources_threshold. * Update python testing as per zed cycle testing runtime In Zed cycle, we have dropped the python 3.6/3.7[1] testing and its support. Add release notes and update the python classifier for the same. [1] https://governance.openstack.org/tc/reference/runtimes/zed.html Co-Authored-By: Ghanshyam Mann Depends-On: https://review.opendev.org/c/openstack/aodh/+/843764 Change-Id: Ia11f25fa8c36c6051a44994f2545e2b64a665593 Closes-Bug: #1974682 --- .zuul.yaml | 2 +- aodhclient/tests/functional/test_alarm.py | 20 +++++++++---------- ...p-python-3-6-and-3-7-c70234384bc69b1d.yaml | 5 +++++ setup.cfg | 5 ++--- tox.ini | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 releasenotes/notes/drop-python-3-6-and-3-7-c70234384bc69b1d.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 54fdbc6..5aa24bc 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,5 +1,5 @@ - project: templates: - - openstack-python3-yoga-jobs + - openstack-python3-zed-jobs - publish-openstack-docs-pti - openstackclient-plugin-jobs diff --git a/aodhclient/tests/functional/test_alarm.py b/aodhclient/tests/functional/test_alarm.py index 6d6c31d..ff4960a 100644 --- a/aodhclient/tests/functional/test_alarm.py +++ b/aodhclient/tests/functional/test_alarm.py @@ -586,14 +586,14 @@ class AodhClientGnocchiRulesTest(base.ClientTestBase): "--query " '\'{"=": {"creator": "cr3at0r"}}\' ' "--resource-type generic " - "--aggregation-method last " + "--aggregation-method mean " "--project-id %s" % PROJECT_ID)) alarm = self.details_multiple(result)[0] ALARM_ID = alarm['alarm_id'] self.assertEqual('alarm1', alarm['name']) self.assertEqual('cpu', alarm['metric']) self.assertEqual('80.0', alarm['threshold']) - self.assertEqual('last', alarm['aggregation_method']) + self.assertEqual('mean', alarm['aggregation_method']) self.assertEqual('generic', alarm['resource_type']) self.assertEqual('{"=": {"creator": "cr3at0r"}}', alarm['query']) @@ -609,7 +609,7 @@ class AodhClientGnocchiRulesTest(base.ClientTestBase): "--query " '\'{"=": {"creator": "cr3at0r"}}\' ' "--resource-type generic " - "--aggregation-method last " + "--aggregation-method mean " "--project-id %s" % PROJECT_ID)) # UPDATE @@ -631,7 +631,7 @@ class AodhClientGnocchiRulesTest(base.ClientTestBase): self.assertEqual('cpu', alarm_show['metric']) self.assertEqual('90.0', alarm_show['threshold']) self.assertEqual('critical', alarm_show['severity']) - self.assertEqual('last', alarm_show['aggregation_method']) + self.assertEqual('mean', alarm_show['aggregation_method']) self.assertEqual('generic', alarm_show['resource_type']) # LIST @@ -793,13 +793,13 @@ class AodhClientGnocchiRulesTest(base.ClientTestBase): "--query " '\'{"=": {"creator": "cr3at0r"}}\' ' "--resource-type generic " - "--aggregation-method last " + "--aggregation-method mean " % ALARM_ID)) alarm_updated = self.details_multiple(result)[0] self.assertEqual(ALARM_ID, alarm_updated["alarm_id"]) self.assertEqual('cpu', alarm_updated['metric']) self.assertEqual('90.0', alarm_updated['threshold']) - self.assertEqual('last', alarm_updated['aggregation_method']) + self.assertEqual('mean', alarm_updated['aggregation_method']) self.assertEqual('generic', alarm_updated['resource_type']) self.assertEqual('{"=": {"creator": "cr3at0r"}}', alarm_updated['query']) @@ -843,13 +843,13 @@ class AodhClientGnocchiRulesTest(base.ClientTestBase): "--query " '\'{"=": {"creator": "cr3at0r"}}\' ' "--resource-type generic " - "--aggregation-method last ")) + "--aggregation-method mean ")) alarm = self.details_multiple(result)[0] ALARM_ID = alarm['alarm_id'] self.assertEqual('alarm123', alarm['name']) self.assertEqual('cpu', alarm['metric']) self.assertEqual('80.0', alarm['threshold']) - self.assertEqual('last', alarm['aggregation_method']) + self.assertEqual('mean', alarm['aggregation_method']) self.assertEqual('generic', alarm['resource_type']) self.assertEqual('{"=": {"creator": "cr3at0r"}}', alarm['query']) @@ -880,13 +880,13 @@ class AodhClientGnocchiRulesTest(base.ClientTestBase): "--query " '\'{"=": {"creator": "cr3at0r"}}\' ' "--resource-type generic " - "--aggregation-method last " + "--aggregation-method mean " % ALARM_ID)) alarm_updated = self.details_multiple(result)[0] self.assertEqual(ALARM_ID, alarm_updated["alarm_id"]) self.assertEqual('cpu', alarm_updated['metric']) self.assertEqual('80.0', alarm_updated['threshold']) - self.assertEqual('last', alarm_updated['aggregation_method']) + self.assertEqual('mean', alarm_updated['aggregation_method']) self.assertEqual('generic', alarm_updated['resource_type']) self.assertEqual('{"=": {"creator": "cr3at0r"}}', alarm_updated['query']) diff --git a/releasenotes/notes/drop-python-3-6-and-3-7-c70234384bc69b1d.yaml b/releasenotes/notes/drop-python-3-6-and-3-7-c70234384bc69b1d.yaml new file mode 100644 index 0000000..db420d7 --- /dev/null +++ b/releasenotes/notes/drop-python-3-6-and-3-7-c70234384bc69b1d.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Python 3.6 & 3.7 support has been dropped. The minimum version of Python now + supported is Python 3.8. diff --git a/setup.cfg b/setup.cfg index d2ed5fe..812c919 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ description_file = author = OpenStack author_email = openstack-discuss@lists.openstack.org home_page = https://docs.openstack.org/python-aodhclient/latest/ -python_requires = >=3.6 +python_requires = >=3.8 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -16,9 +16,8 @@ classifier = Programming Language :: Python Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 [files] packages = diff --git a/tox.ini b/tox.ini index f3e5f1d..51d2051 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.1.1 -envlist = py38,pep8 +envlist = py38,py39,pep8 skipsdist = True ignore_basepython_conflict = True