Compare commits

...

6 Commits

Author SHA1 Message Date
bf19cbc327 Update .gitreview for unmaintained/wallaby
Change-Id: Id386071eed9072e9ca40f4b69e78862423110a55
2024-03-05 18:37:32 +00:00
8636b3dbb5 Use assertCountEqual instead of assertItemsEqual
The assertItemsEqual method has been removed in Python 3.3 [1] but
it was kept alive by unittest2, imported by testtools. For better
compatibility, change to assertCountEqual.

[1] https://bugs.python.org/issue17866

Change-Id: Iea76915f25eb2e505750d509bdd06758afe324de
(cherry picked from commit b5603cc45c)
2022-12-16 13:33:40 +00:00
Manpreet Kaur
900a1aa78e Fix failing UT in TestListVnfLcmOp
The unit test 'tackerclient.tests.unit.osc.v1.test_vnflcm_op_occs.
TestListVnfLcmOp.test_take_action_with_filter' is failing with below
error message,
DEBUG: TypeError: Object of type 'FormatComplexDataColumn' is not
JSON serializable

Background:
In class TestListVnfLcmOp definition, "create_vnflcm_op_occs" function
is called and list of fake vnflcm op occs dictionary is store in
vnflcm_op_occs_obj.
Now this dictionary is used in two unit test cases "test_take_action"
and "test_take_action_with_filter".
In order to evaluate test results, in "test_take_action" test case,
"get_vnflcm_op_occ_data" function is called using "vnflcm_op_occs_obj"
which appends the data in dictionary.

Later this dictionary "vnflcm_op_occs_obj" is again used in
"test_take_action_with_filter".

Implementation:
This patch creates a separate list of fake vnflcm op occs dictionary for
both the test cases.

This issue has been impacting below reviews as well,
[1] https://review.opendev.org/c/openstack/python-tackerclient/+/636893
[2] https://review.opendev.org/c/openstack/python-tackerclient/+/781314

Co-Authored: Yasufumi Ogawa <yasufum.o@gmail.com>
Closes-Bug: #1919350
Change-Id: I0d62f77cf5d1e9ec0b0a7c404abab83f97b708ba
2022-01-06 06:45:09 +00:00
21abb7ffd0 Update TOX_CONSTRAINTS_FILE for stable/wallaby
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/wallaby branch, tests will
continue to use the upper-constraints list on master.

Change-Id: I8f54797a47e23e4cf549792e1888db3774274405
2021-09-23 17:56:18 +00:00
ecdf16a9b7 Update .gitreview for stable/wallaby
Change-Id: I9d2601aec639061a339b2ebdfe8826e208b90d97
2021-09-23 17:55:58 +00:00
Yasufumi Ogawa
1a457e074a Drop test for lower constraints
As we agreed, drop lower constraints test from stable branches to avoid
difficulty of maintaining package depencencies for the recent pip
dependency resolver.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: I24f675a0836eacef264254bb5da05286a1edf161
2021-09-22 16:27:23 +09:00
5 changed files with 17 additions and 77 deletions

View File

@@ -2,3 +2,4 @@
host=review.opendev.org
port=29418
project=openstack/python-tackerclient.git
defaultbranch=unmaintained/wallaby

View File

@@ -1,7 +1,6 @@
- project:
templates:
- check-requirements
- openstack-lower-constraints-jobs
- openstack-python3-wallaby-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3

View File

@@ -1,56 +0,0 @@
appdirs==1.3.0
Babel==2.3.4
cliff==2.8.0
cmd2==0.8.0
coverage==4.0
ddt==1.0.1
debtcollector==1.2.0
decorator==3.4.0
deprecation==1.0
dogpile.cache==0.6.2
extras==1.0.0
fixtures==3.0.0
iso8601==0.1.11
jmespath==0.9.0
jsonpatch==1.16
jsonpointer==1.13
keystoneauth1==3.4.0
linecache2==1.0.0
monotonic==0.6
msgpack-python==0.4.0
munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
openstacksdk==0.11.2
os-client-config==1.28.0
os-service-types==1.2.0
osc-lib==1.8.0
oslo.config==5.2.0
oslo.context==2.19.2
oslo.i18n==3.15.3
oslo.log==3.36.0
oslo.serialization==2.18.0
oslo.utils==3.40.0
pbr==2.0.0
positional==1.2.1
prettytable==0.7.2
pyinotify==0.9.6
pyparsing==2.1.0
pyperclip==1.5.27
python-dateutil==2.5.3
python-keystoneclient==3.8.0
python-mimeparse==1.6.0
python-subunit==1.0.0
pytz==2013.6
PyYAML==3.12
requests==2.14.2
requests-mock==1.2.0
requestsexceptions==1.2.0
rfc3986==0.3.1
simplejson==3.5.1
stestr==2.0.0
stevedore==1.20.0
testtools==2.2.0
traceback2==1.4.0
unittest2==1.1.0
wrapt==1.7.0

View File

@@ -340,19 +340,19 @@ class TestRetryVnfLcmOp(TestVnfLcm):
class TestListVnfLcmOp(TestVnfLcm):
vnflcm_op_occs_obj = vnflcm_op_occs_fakes.create_vnflcm_op_occs(count=3)
def setUp(self):
super(TestListVnfLcmOp, self).setUp()
self.list_vnflcm_op_occ = vnflcm_op_occs.ListVnfLcmOp(
self.app, self.app_args, cmd_name='vnflcm op list')
def test_take_action(self):
vnflcm_op_occs_obj = vnflcm_op_occs_fakes.create_vnflcm_op_occs(
count=3)
parsed_args = self.check_parser(self.list_vnflcm_op_occ, [], [])
self.requests_mock.register_uri(
'GET', os.path.join(self.url,
'vnflcm/v1/vnf_lcm_op_occs'),
json=self.vnflcm_op_occs_obj, headers=self.header)
json=vnflcm_op_occs_obj, headers=self.header)
actual_columns, data = self.list_vnflcm_op_occ.take_action(parsed_args)
@@ -360,15 +360,17 @@ class TestListVnfLcmOp(TestVnfLcm):
self.list_vnflcm_op_occ.get_attributes(), long_listing=True)
expected_data = []
for vnflcm_op_occ_obj in self.vnflcm_op_occs_obj:
for vnflcm_op_occ_obj_idx in vnflcm_op_occs_obj:
expected_data.append(vnflcm_op_occs_fakes.get_vnflcm_op_occ_data(
vnflcm_op_occ_obj, columns=columns))
vnflcm_op_occ_obj_idx, columns=columns))
self.assertItemsEqual(_get_columns_vnflcm_op_occs(action='list'),
self.assertCountEqual(_get_columns_vnflcm_op_occs(action='list'),
actual_columns)
self.assertItemsEqual(expected_data, list(data))
self.assertCountEqual(expected_data, list(data))
def test_take_action_with_filter(self):
vnflcm_op_occs_obj = vnflcm_op_occs_fakes.create_vnflcm_op_occs(
count=3)
parsed_args = self.check_parser(
self.list_vnflcm_op_occ,
["--filter", '(eq,operationState,STARTING)'],
@@ -378,7 +380,7 @@ class TestListVnfLcmOp(TestVnfLcm):
self.url,
'vnflcm/v1/vnf_lcm_op_occs?'
'filter=(eq,operationState,STARTING)'),
json=self.vnflcm_op_occs_obj, headers=self.header)
json=vnflcm_op_occs_obj, headers=self.header)
actual_columns, data = self.list_vnflcm_op_occ.take_action(parsed_args)
@@ -386,11 +388,11 @@ class TestListVnfLcmOp(TestVnfLcm):
self.list_vnflcm_op_occ.get_attributes(), long_listing=True)
expected_data = []
for vnflcm_op_occ_obj in self.vnflcm_op_occs_obj:
for vnflcm_op_occ_obj_idx in vnflcm_op_occs_obj:
expected_data.append(vnflcm_op_occs_fakes.get_vnflcm_op_occ_data(
vnflcm_op_occ_obj, columns=columns))
vnflcm_op_occ_obj_idx, columns=columns))
self.assertItemsEqual(_get_columns_vnflcm_op_occs(action='list'),
self.assertCountEqual(_get_columns_vnflcm_op_occs(action='list'),
actual_columns)
self.assertListItemsEqual(expected_data, list(data))
@@ -457,7 +459,7 @@ class TestShowVnfLcmOp(TestVnfLcm):
columns, data = (self.show_vnf_lcm_op_occs.take_action(parsed_args))
self.assertItemsEqual(_get_columns_vnflcm_op_occs(),
self.assertCountEqual(_get_columns_vnflcm_op_occs(),
columns)
def test_take_action_vnf_lcm_op_occ_id_not_found(self):

10
tox.ini
View File

@@ -13,7 +13,7 @@ setenv = VIRTUAL_ENV={envdir}
usedevelop = True
install_command = pip install {opts} {packages}
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
@@ -31,7 +31,7 @@ commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@@ -53,9 +53,3 @@ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools
# F821 undefined name 'unicode'
# if isinstance(config, str) or isinstance(config, unicode):
builtins = unicode
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt