[Starlingx-discuss] add unit test to zuul

Sun, Austin austin.sun at intel.com
Sun Aug 26 01:55:22 UTC 2018


Hi AI:
Thanks . I found a way to fix "rpm package" issue.
https://review.openstack.org/#/c/596563/.

Thanks.
BR
Austin Sun.



From: Bailey, Henry Albert (Al) [mailto:Al.Bailey at windriver.com]
Sent: Friday, August 24, 2018 10:59 PM
To: Sun, Austin <austin.sun at intel.com>; An, Ran1 <ran1.an at intel.com>; Liu, Tao <Tao.Liu at windriver.com>; starlingx-discuss at lists.starlingx.io
Subject: RE: [Starlingx-discuss] add unit test to zuul

You can use a similar trick in controllerconfig  for fm_core

Add something like this to    controllerconfig/tests/__init__.py

try:
    import fm_core
except:
    import mock
    import sys
    sys.modules['fm_core'] = mock.Mock()

The tox.ini paths also need to be adjusted.
The tests themselves are failing due to version discrepencies (18.03 vs 18.04).  I have not looked into this.


For the rpm package,  in Centos the  rpm-python package needed to be yum installed and site-packages set to true in tox.ini.
I don't have Ubuntu experience but from what I have read, Ubuntu uses Debian format instead of RPM so the code would likely need to be written differently to work in an Ubuntu env.

Al


From: Sun, Austin [mailto:austin.sun at intel.com]
Sent: Friday, August 24, 2018 10:31 AM
To: Bailey, Henry Albert (Al); An, Ran1; Liu, Tao; starlingx-discuss at lists.starlingx.io<mailto:starlingx-discuss at lists.starlingx.io>
Subject: RE: [Starlingx-discuss] add unit test to zuul

Hi AI and All:
Thanks.  https://review.openstack.org/#/c/595352/ was merged, but An ran is working on controlconfig , which is different unit test with sysinv.

Can it use similar fix for controlconfig ?

BTW:  I met "ImportError: No module named rpm" in Ubuntu platform for sysinv unit test.

Do you know how to install python rpm package in Ubuntu ?  I tried several ways ,  but none worked.

Thanks.
BR
Austin Sun.

From: Bailey, Henry Albert (Al) [mailto:Al.Bailey at windriver.com]
Sent: Friday, August 24, 2018 9:19 PM
To: An, Ran1 <ran1.an at intel.com<mailto:ran1.an at intel.com>>; Liu, Tao <Tao.Liu at windriver.com<mailto:Tao.Liu at windriver.com>>; starlingx-discuss at lists.starlingx.io<mailto:starlingx-discuss at lists.starlingx.io>
Subject: Re: [Starlingx-discuss] add unit test to zuul

You should be able to run tox -e py27 now since this commit was merged
https://github.com/openstack/stx-config/commit/b9ce2626ff452d3c9ffc58cdbcac3c0d85b13716

Al

From: An, Ran1 [mailto:ran1.an at intel.com]
Sent: Thursday, August 23, 2018 10:15 PM
To: Liu, Tao; starlingx-discuss at lists.starlingx.io<mailto:starlingx-discuss at lists.starlingx.io>
Subject: [Starlingx-discuss] add unit test to zuul

Hi:
      I'm looking to add exist unit tests of controlconfig(under project stx-config) to zuul but 2 of them are fail now.
The error note that can't import module "fm_core" which seams be imported by commit https://git.openstack.org/cgit/openstack/stx-fault/commit/fm-api/fm_api/fm_api.py?id=c8159ea6cbace0a23a7639fc41d5c73619e70704.
     Does anyone is on the way to fixing this?

Thanks
Ran An
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.starlingx.io/pipermail/starlingx-discuss/attachments/20180826/5edb973a/attachment.html>


More information about the Starlingx-discuss mailing list