Doveps / mono

Code for Doveps projects
http://doveps.com
MIT License
0 stars 0 forks source link

03-22-2018: Suggestion to Transfer to Nose tests #129

Closed JosiahRegencia closed 6 years ago

JosiahRegencia commented 6 years ago

ERROR: for mono_db_1 Cannot start service db: driver failed programming external connectivity on endpoint mono_db_1 (bb18c09e9334d94c737b012181d498ec2febc023472fff0080ee97a2d95ca736): Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use

That part, pgadmin can't be run while using the docker

At the same time, locally, I ran the tests without using docker with pgadmin up and running. screenshot from 2018-03-22 19-28-24

This was the result. Still the same. After some reading, I found this one,

https://pypi.python.org/pypi/testing.postgresql

I think this can help. However, I may need to redo the tests using nose test. https://github.com/walkermatt/python-postgres-testing-demo Found this as reference. Studying nose tests in case you allow me redoing the tests. Reference: https://www.safaribooksonline.com/blog/2013/12/05/flask-with-mock-and-nose/

JosiahRegencia commented 6 years ago

Added

https://github.com/Doveps/mono/blob/7ae185b92d406a7c50b27cae293b34f167c2be55/savant/tests/test_basic.py#L12-L15

Not working yet. Still trying to understand it.

greenmoss commented 6 years ago

See if you can get past the db connection issue. I think you are on the right track after we communicated earlier today (yesterday?). It is very important to be using the db docker container "mono_db_1" for all of your testing. That is because that docker container ensures all setup is correct for the automated tests, and for potential other users later. If you get errors starting it, make sure to fix those. Also please keep an eye out for wiki documentation that is not clear to you and either message me, or make the fix directly if you are comfortable doing that.

For nose testing, I'd say be careful in redirecting to a new framework. All of them are roughly equivalent in what they offer, so it should be possible to extend your tests using our current framework. I personally preferred pytest and know a lot of people use it. I believe unittest is what we are using right now for doveps code.

Personally, I feel like we should continue along the path we started already, in the interest of getting the demo working. However if you feel strongly about it I suggest reading some comparisons. Here's one I found after searching for "nosetests vs pytest":

http://pythontesting.net/transcripts/2-pytest-vs-unittest-vs-nose/