docker-flask-mongodb-example icon indicating copy to clipboard operation
docker-flask-mongodb-example copied to clipboard

Update python libraries in requirements.txt to latest stable versions

Open danionescu0 opened this issue 3 years ago • 17 comments

test if all works ok

danionescu0 avatar Feb 24 '21 10:02 danionescu0

Hi. Can I take this up?

neelabalan avatar Feb 24 '21 10:02 neelabalan

Sure. Just please test all services (api requests)

danionescu0 avatar Feb 24 '21 11:02 danionescu0

Sure. Is there any testing methodoloy involved here or will it be just testing the requests individually with curl

neelabalan avatar Feb 24 '21 11:02 neelabalan

Curl for now, or if you want to automate it you i've raised an issue some time ago: https://github.com/danionescu0/docker-flask-mongodb-example/issues/20

There are functional tests libraries, you can use pyramid for example: https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/testing.html

Tell me what you decide

danionescu0 avatar Feb 24 '21 11:02 danionescu0

I haven't worked on functional tests before. For now I will test it with curl and do some reading on functional tests.

neelabalan avatar Feb 24 '21 11:02 neelabalan

Ok, let me know if i can help you with it

danionescu0 avatar Feb 24 '21 11:02 danionescu0

Sure. Thank you.

neelabalan avatar Feb 24 '21 11:02 neelabalan

You can test easily from the Swagger interface

danionescu0 avatar Feb 24 '21 11:02 danionescu0

Yeah. I did that for testing #51

neelabalan avatar Feb 24 '21 12:02 neelabalan

Hi. I have completed testing all the services after the updating the packages to latest stable versions. I haven't updated the version for pymongo driver because updating to latest version was causing some error after the update. I cound't figure out the cause of the error but I can see that this has to do with create_index.

detailed error from logs

web-fulltext-search_1     | Traceback (most recent call last):
web-fulltext-search_1     |   File "/root/flask-mongodb-example/python/fulltext_search.py", line 81, in <module>
web-fulltext-search_1     |     fulltext_search.create_index([('app_text', TEXT)], name='fulltextsearch_index', default_language='english')
web-fulltext-search_1     |   File "/usr/local/lib/python3.8/site-packages/pymongo/collection.py", line 2059, in create_index
web-fulltext-search_1     |     return self.__create_indexes([index], session, **cmd_options)[0]
web-fulltext-search_1     |   File "/usr/local/lib/python3.8/site-packages/pymongo/collection.py", line 1949, in __create_indexes
web-fulltext-search_1     |     self._command(
web-fulltext-search_1     |   File "/usr/local/lib/python3.8/site-packages/pymongo/collection.py", line 238, in _command
web-fulltext-search_1     |     return sock_info.command(
web-fulltext-search_1     |   File "/usr/local/lib/python3.8/site-packages/pymongo/pool.py", line 699, in command
web-fulltext-search_1     |     self._raise_connection_failure(error)
web-fulltext-search_1     |   File "/usr/local/lib/python3.8/site-packages/pymongo/pool.py", line 683, in command
web-fulltext-search_1     |     return command(self, dbname, spec, slave_ok,
web-fulltext-search_1     |   File "/usr/local/lib/python3.8/site-packages/pymongo/network.py", line 159, in command
web-fulltext-search_1     |     helpers._check_command_response(
web-fulltext-search_1     |   File "/usr/local/lib/python3.8/site-packages/pymongo/helpers.py", line 151, in _check_command_response
web-fulltext-search_1     |     raise NotMasterError(errmsg, response)
web-fulltext-search_1     | pymongo.errors.NotMasterError: not master, full error: {'topologyVersion': {'processId': ObjectId('60365e9c3243f6762818c4aa'), 'counter': 0}, 'operationTime': Timestamp(0, 0), 'ok': 0.0, 'errmsg': 'not master', 'code': 10107, 'codeName': 'NotWritablePrimary', '$clusterTime': {'clusterTime': Timestamp(0, 0), 'signature': {'hash': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'keyId': 0}}}
docker-flask-mongodb-example_web-fulltext-search_1 exited with code 1

neelabalan avatar Feb 25 '21 09:02 neelabalan

I've updated the packages for requirements.txt, requirements-restplus.txt and requirements-fastapi.txt

Here are the commands I used for testing all the services after referring to both the Github documentation and Swagger interface

Let me know if I can raise a PR for the package updates.

neelabalan avatar Feb 25 '21 09:02 neelabalan

That's great news! Please raise a PR and about the testing commands , i think they'll be usefull for semi-automatic testing until functional testing is in place. Could you put the in the root folder of the projec, name it testing.txt and maybe use curl inside so that it can be copy-paste it easily? Thanks

danionescu0 avatar Feb 25 '21 10:02 danionescu0

Sure. For the commands I used httpie for all the testing since it was easy to work and has inbuilt JSON support. I will move all of those commands to curl and raise a seperate PR.

neelabalan avatar Feb 25 '21 10:02 neelabalan

Oh i see, well i looked in diagonal and haven't noticed. Curl it's more used but you can live it with httpie if you like.

danionescu0 avatar Feb 25 '21 10:02 danionescu0

Moving them to curl shouldn't take much work. I will do short test and port them.

neelabalan avatar Feb 25 '21 10:02 neelabalan

I totally forgot to add here that I haven't updated the Werkzeug package (0.16.1) to latest version (1.0.0) in requirement-restuplus.txt because I found that updating it causes errors and those need to be fixed from flask-restplus side which I think won't be happening because the flask-restplus project is no longer maintained.

https://github.com/noirbizarre/flask-restplus/issues/770

neelabalan avatar Feb 26 '21 06:02 neelabalan

Oh ok, that's all right we'll postpone the update until they have someting stable

danionescu0 avatar Feb 26 '21 08:02 danionescu0