Grommash9 / tg_chat_mate

https://grommash9.github.io/tg_chat_mate/
MIT License
5 stars 6 forks source link

Python testing should be done before deploying #173

Closed Jonatan-Chaverri closed 9 months ago

Jonatan-Chaverri commented 9 months ago

Python tests should run before deploying the bot image, in that way we can prevent breaking test environment.

While testing against the real live project can provide feedback in real time, it is also time consuming and makes it hard to add new tests that requires data in the db.

I propose the following changes

Grommash9 commented 9 months ago

Yes, we should have it for sure.

I like post deploy tests because it can help me to understand our services are working fine together, like redis and mongo db are accessible from both

But you are totally right what we need mocking and covering and tests before deploy stage

Also i want to mention it's not real deploy, is our test server and the logic of it is to check nginx config working fine and code is ready to be deployed to customers, we are uninstalling it after deploy, so maybe we should rename these stage it future to prevent confusion

Grommash9 commented 9 months ago

So i think we should add right tests for sure with mocking but at same time I am not sure i want remove all post deploy tests, I like it really and I think they are able to test more different things and make us sure all is working fine

It's like QA automation if we can say it

Maybe we also should rename it somehow

Jonatan-Chaverri commented 9 months ago

You are right, its valuable to have those tests also.

Maybe what we can do is have like a separate job running periodically against the test environment with those post deploy tests. Not sure if travis have that capability.

But for PRs, my opinion is that we should not run them, because they take a lot of time to complete and when the app starts to grow it will get worse. For PRs only unittest should be running.

I can take care of creating those unit test. Will try to hit at least 80% of the code. But let me know if you agree before start working on this that potentially can take some time.

Grommash9 commented 9 months ago

Yes, i want to have it for sure.

I am not sure now about removing post deploy test part to be honest, but i will think how to speed it up, have some ideas

Grommash9 commented 9 months ago

Was closed in

https://github.com/Grommash9/tg_chat_mate/pull/175