<div dir="ltr">Let me try to explain some.<br><div class="gmail_extra"><br><div class="gmail_quote">On 22 March 2016 at 10:09, Shinobu Kinjo <span dir="ltr"><<a href="mailto:shinobu.kj@gmail.com" target="_blank">shinobu.kj@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Mar 22, 2016 at 10:22 AM, joehuang <<a href="mailto:joehuang@huawei.com">joehuang@huawei.com</a>> wrote:<br>
> Hello, Shinobu,<br>
><br>
> 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.<br>
<br>
</span>Thank you for your thought.<br>
<span class=""><br>
><br>
> 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,<br>
<br>
</span>I'm assuming the migration scripts are in "tricircle/db". Is it right?<br></blockquote><div><br></div><div>migration scripts are in tricircle/db/migrate_repo</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What is the DB model?<br>
Why do we need 2-way-methods at the moment?<br></blockquote><div><br></div><div>DB models are defined in tricircle/db/models.py. Models.py defines tables in object level, so other modules can import models.py then operate the tables by operating the objects. Migration scripts defines tables in table level, you define table fields, constraints in the scripts then migration tool will read the scripts and build the tables. Migration tool has a feature to generate migration scripts from DB models automatically but it may make mistakes sometimes, so currently we manually maintain the table structure in both DB model and migration scripts. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> 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.<br>
<br>
</span>If I understand you correctly, we are moving forward to using the<br>
migration scripts for both unit and integration tests.<br>
<br>
Cheers,<br>
Shinobu<br>
<span class="im HOEnZb"><br>
><br>
> (Also move the discussion to the openstack-dev mail-list)<br>
><br>
> Best Regards<br>
> Chaoyi Huang ( joehuang )<br>
><br>
> -----Original Message-----<br>
> From: Shinobu Kinjo [mailto:<a href="mailto:skinjo@redhat.com">skinjo@redhat.com</a>]<br>
> Sent: Tuesday, March 22, 2016 7:43 AM<br>
> To: joehuang; khayam.gondal; zhangbinsjtu; shipengfei92; newypei; Liuhaixia; caizhiyuan (A); huangzhipeng<br>
> Subject: Using in-memory database for unit tests<br>
><br>
> Hello,<br>
><br>
> 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.<br>
><br>
> What do you think?<br>
> Any thought, suggestion would be appreciated.<br>
><br>
> [1] <a href="https://github.com/openstack/tricircle/blob/master/tricircle/db/core.py#L124-L127" rel="noreferrer" target="_blank">https://github.com/openstack/tricircle/blob/master/tricircle/db/core.py#L124-L127</a><br>
><br>
> Cheers,<br>
> Shinobu<br>
> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br>
<br>
<br>
</span><span class="HOEnZb"><font color="#888888">--<br>
Email:<br>
<a href="mailto:shinobu@linux.com">shinobu@linux.com</a><br>
GitHub:<br>
shinobu-x<br>
Blog:<br>
Life with Distributed Computational System based on OpenSource<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div></div>