Open danionescu0 opened 3 years ago
Hi. Can I take this up?
Sure. Just please test all services (api requests)
Sure. Is there any testing methodoloy involved here or will it be just testing the requests individually with curl
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
I haven't worked on functional tests before. For now I will test it with curl and do some reading on functional tests.
Ok, let me know if i can help you with it
Sure. Thank you.
You can test easily from the Swagger interface
Yeah. I did that for testing #51
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
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.
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
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.
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.
Moving them to curl shouldn't take much work. I will do short test and port them.
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.
Oh ok, that's all right we'll postpone the update until they have someting stable
test if all works ok