[openstack-dev] [tricircle] Using in-memory database for unit tests
joehuang
joehuang at huawei.com
Tue Mar 22 01:22:47 UTC 2016
Hello, Shinobu,
Yes, as what you described here, the "initialize" in "core.py" is used for unit/function test only. For system integration test( for example, tempest ), it would be better to use mysql like DB, this is done by the configuration in DB part.
From my point of view, the tricircle DB part could be enhanced in the DB model and migration scripts. Currently unit test use DB model to initialize the data base, but not using the migration scripts, so the migration scripts can only be tested when using devstack for integration test. It would better to using migration script to instantiate the DB, and tested in the unit test too.
(Also move the discussion to the openstack-dev mail-list)
Best Regards
Chaoyi Huang ( joehuang )
-----Original Message-----
From: Shinobu Kinjo [mailto:skinjo at redhat.com]
Sent: Tuesday, March 22, 2016 7:43 AM
To: joehuang; khayam.gondal; zhangbinsjtu; shipengfei92; newypei; Liuhaixia; caizhiyuan (A); huangzhipeng
Subject: Using in-memory database for unit tests
Hello,
In "initialize" method defined in "core.py", we're using *in-memory* strategy making use of sqlite. AFAIK we are using this solution for only testing purpose. Unit tests using this solution should be fine for small scale environment. But it's not good enough even it's for testing.
What do you think?
Any thought, suggestion would be appreciated.
[1] https://github.com/openstack/tricircle/blob/master/tricircle/db/core.py#L124-L127
Cheers,
Shinobu
More information about the OpenStack-dev
mailing list