Closed ocefpaf closed 7 years ago
Thanks @ocefpaf. @lsetiawan will get back to you tomorrow.
Being able to deploy CI tests involving relational databases will be very helpful not just for WOFpy, but for other ODM2 software as well, including odm2api and an ODM2 REST API we're developing.
Do we need both mysql and postgresql or can we start with one and expand to more testing later?
I think we can start with one and expand later.
I recall that we had to enable sudo in odm2api, can we avoid that here (see sudo service mysql stop that stops the service and the scripts restarts it later.)?
If we are not using mysql, we can definitely avoid this, but for mysql, there is no way to avoid it. 😞
I believe we'll need some data for the service, do we already have that in the repo (I could not find any .sql file)?
I'll find you a nice .sql
example. The envirodiy is a good testing case, and it does have the unicode error.
The envirodiy is a good testing case, and it does have the unicode error.
Awesome!
If we are not using mysql, we can definitely avoid this, but for mysql, there is no way to avoid it.
You mean we can test with postgresql
and avoid that? If so let's try that. If not we can live with sudo
enable. It is slower but not too bad.
I think we can start with one and expand later.
Let me know the answer of the question above and I'll adapt this PR accordingly.
@ocefpaf I have sent an email to the group checking to see if it's appropriate to use the envirodiy database as a test case. Stay tuned! Thanks 😄
@ocefpaf I have sent an email to the group checking to see if it's appropriate to use the envirodiy database as a test case.
Saw that. Thanks!
BTW, how hard it is to create one with fake data? I do prefer a real case scenario, just wondering if we can do something here that is self-contained.
BTW, how hard it is to create one with fake data?
I think it would be too complex to meet all the function testing. There's already some fake data here. But I think we should make the current test match the actual application like I said on https://github.com/ODM2/WOFpy/pull/188#issuecomment-326685770 to start with.
But I think we should make the current test match the actual application
I agree. Just wondering in case we face some roadblocks.
Also, with a real case scenario, we can make start creating some integration tests that can catch unforeseen errors in the unittests.
@ocefpaf Should I merge this and continue development?
Did you see my https://github.com/ODM2/WOFpy/pull/193#issuecomment-331479994 ?
If you want to go ahead with mysql
you can merge. If not let me know :smile:
mysql
requires sudo. I think we should start with postgresql.
OK, changed that yo be only postgresql
. Did you get the green to use the database?
Did you get the green to use the database?
Yepp. I did. I have shared with you via email the sql file. Thanks.
Once travis is green. I will merge your changes.
Yepp. I did. I have shared with you via email the sql file. Thanks.
Awesome!
@lsetiawan this is not ready yet and I'll need your help to continue.
For now this PR only adds the
mysql
andpostgresql
services.Below you'll find the script we have in
odm2api
. Not sure how to edit that to provide a similar functionality forWOFpy
. So here are my questions:mysql
andpostgresql
or can we start with one and expand to more testing later?sudo
inodm2api
, can we avoid that here (seesudo service mysql stop
that stops the service and the scripts restarts it later.)?.sql
file)?I am available tomorrow afternoon if you want to (g)talk these out.