Doveps / mono

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

03-23-2018 Report: Continue integrating testing.postgresql to unit tests #130

Closed JosiahRegencia closed 6 years ago

JosiahRegencia commented 6 years ago

Added setup code:

https://github.com/Doveps/mono/blob/a834f3ad3493d34a7a4bf681aaa20b168141cdc5/savant/tests/test_basic.py#L12-L19

Tested it locally doesn't seem to work. Tested it inside docker, I got this:

screenshot from 2018-03-23 23-17-16

Personally I think this is a step closer. But I'm not sure what you guys think.

greenmoss commented 6 years ago

Do you have a code branch, so I can check out the underlying code?

It appears to be getting stuck looking for initdb. If that is the case, I am also guessing it hasn't yet attempted to connect to the db.

What does initdb do? If it is setting up test db entries, that is ok to start with. That said, it should not be creating tables or functions; the latter is already performed during db container start. Specifically, check out the scripts in https://github.com/Doveps/mono/tree/master/db/scripts.

JosiahRegencia commented 6 years ago

I'm testing this under the branch: fix_test_discrepancy

It got me thinking, maybe this doesn't read and write because a database wasn't created in the sql scripts?

greenmoss commented 6 years ago

Got it. The best way to test that is to connect with pg_admin and look around. Assuming the db container started with no port conflict, pg_admin will show you what is in it.

JosiahRegencia commented 6 years ago

But when running pg_admin I get this: 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

so I have to run this: /etc/init.d/postgresql stop which seems to stop pg_admin