settingsLogin | Registersettings

[openstack-dev] [nova]Question about unit tests for shelve/unshleve

0 votes

Hi all,

I have a question about unit tests of nova.
(I found this question when I fixed a bug about shelve.1)

"nova.tests.unit.compute.testshelve.ShelveComputeAPITestCase" has
test cases for "nova.compute.api.API.shelve()/unshelve()".
But "nova.tests.unit.compute.test
computeapi.ComputeAPIUnitTestMixIn"
also has test cases for same methods.

Is their purpose duplicated?
And, can I organize them if their purpose is duplicated?

FYI, I think that we should consolidate them into
"nova.tests.unit.compute.testcomputeapi._ComputeAPIUnitTestMixIn".
Because it is inherited to some test classes.

Best regards,
--
Rikimaru Honjo
E-mail:honjo.rikimaru@po.ntts.co.jp


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
asked Oct 16, 2016 in openstack-dev by Rikimaru_Honjo (660 points)   2
retagged Jan 26, 2017 by admin

2 Responses

0 votes

On Sun, Oct 16, 2016, at 07:11 AM, Rikimaru Honjo wrote:
Hi all,

I have a question about unit tests of nova.
(I found this question when I fixed a bug about shelve.[1])

"nova.tests.unit.compute.testshelve.ShelveComputeAPITestCase" has
test cases for "nova.compute.api.API.shelve()/unshelve()".
But "nova.tests.unit.compute.test
computeapi.ComputeAPIUnitTestMixIn"
also has test cases for same methods.

Is their purpose duplicated?
And, can I organize them if their purpose is duplicated?

I just looked at them briefly and they're not exactly duplicates. It
appears that testshelve.py has more functional tests and
test
compute_api.py is more unit tests. But it would be nice to have
them all in the same place.

FYI, I think that we should consolidate them into
"nova.tests.unit.compute.testcomputeapi._ComputeAPIUnitTestMixIn".
Because it is inherited to some test classes.

Personally I would prefer consolidating them into test_shelve.py because
_ComputeAPIUnitTestMixin is a giant class and it can be hard to discover
where something is tested. I like having the features tested in a
dedicated test file.

[1]: https://bugs.launchpad.net/nova/+bug/1588657

Best regards,
--
Rikimaru Honjo
E-mail:honjo.rikimaru@po.ntts.co.jp


OpenStack Development Mailing List (not for usage questions)
Unsubscribe:
OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Oct 17, 2016 by andrew_at_lascii.com (6,820 points)   1 2 5
0 votes

On 2016/10/18 3:50, Andrew Laski wrote:

On Sun, Oct 16, 2016, at 07:11 AM, Rikimaru Honjo wrote:

Hi all,

I have a question about unit tests of nova.
(I found this question when I fixed a bug about shelve.[1])

"nova.tests.unit.compute.testshelve.ShelveComputeAPITestCase" has
test cases for "nova.compute.api.API.shelve()/unshelve()".
But "nova.tests.unit.compute.test
computeapi.ComputeAPIUnitTestMixIn"
also has test cases for same methods.

Is their purpose duplicated?
And, can I organize them if their purpose is duplicated?

I just looked at them briefly and they're not exactly duplicates. It
appears that testshelve.py has more functional tests and
test
compute_api.py is more unit tests. But it would be nice to have
them all in the same place.
Thank you for explaining and suggesting!
I start planning about consolidating tests for shelve.

FYI, I think that we should consolidate them into
"nova.tests.unit.compute.testcomputeapi._ComputeAPIUnitTestMixIn".
Because it is inherited to some test classes.

Personally I would prefer consolidating them into testshelve.py because
_ComputeAPIUnitTestMixin is a giant class and it can be hard to discover
where something is tested. I like having the features tested in a
dedicated test file.
Your opinion is more convincing than my opinion.
I'll consolidate them into test
shelve.py.

[1]: https://bugs.launchpad.net/nova/+bug/1588657

Best regards,
--
Rikimaru Honjo
E-mail:honjo.rikimaru@po.ntts.co.jp


OpenStack Development Mailing List (not for usage questions)
Unsubscribe:
OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Oct 18, 2016 by Rikimaru_Honjo (660 points)   2
...