danionescu0 / docker-flask-mongodb-example

Uses docker compose with a python flask microservice and MongoDB instance to make a sample application
GNU General Public License v3.0
99 stars 41 forks source link

added more tests for user demo #20 #64

Closed neelabalan closed 3 years ago

neelabalan commented 3 years ago

I've added a drop function in the utils to take care of dropping the collection after every test, This is handled in the pytest fixture. Let me know if changes needed.

danionescu0 commented 3 years ago

If you use the drop function you will need to recreate the special index (there are services with special indexes)

neelabalan commented 3 years ago

I think there are 3 services using create_index out of 9. I think I will figure out a way recreate the index for those 3 since pytest.fixture is limited to only that testing module and I could use the drop for other 6. I'll go back to the previous (delete after every test) approach if you think that won't work.

danionescu0 commented 3 years ago

I think the drop will be find, but we must recreate the index to keep the consistency of the services.

neelabalan commented 3 years ago

I think the drop will be find, but we must recreate the index to keep the consistency of the services.

so what do you suggest?

danionescu0 commented 3 years ago

Well the indexes are recreated on the services are restarted so it's not big deal. We could re-create the indexes from the tests manually .

danionescu0 commented 3 years ago

a pre commit hook might be great