Fix backend.get_task_meta ignores the result_extended config parameter in mongodb backend#8391
Fix backend.get_task_meta ignores the result_extended config parameter in mongodb backend#8391auvipy merged 6 commits intocelery:mainfrom ycc140:main
Conversation
Fix for bug report: #8387. backend.get_task_meta ignores the result_extended config parameter in mongodb backend
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #8391 +/- ##
=======================================
Coverage 87.07% 87.07%
=======================================
Files 148 148
Lines 18492 18494 +2
Branches 3152 3153 +1
=======================================
+ Hits 16102 16104 +2
Misses 2110 2110
Partials 280 280
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
| obj = self.collection.find_one({'_id': task_id}) | ||
| if obj: | ||
| if self.app.conf.find_value_for_key('extended', 'result'): | ||
| return self.meta_from_decoded({ |
There was a problem hiding this comment.
we will need full unit test coverage for this change
There was a problem hiding this comment.
Ok. Being a newbie here I have no idea how to write a unit test for this. The only tests that I could find was in the pytest-celery repo but I could not figure out where to do a pull request for the test coverage.
There was a problem hiding this comment.
you can check this file https://github.com/celery/celery/blob/main/t/unit/backends/test_mongodb.py and other back end tests in https://github.com/celery/celery/blob/main/t/unit/backends/ folder
There was a problem hiding this comment.
Thanks for the pointers. I have added a new test case, It works on my laptop :-)
Reformatted code with correct indentation.
| obj = self.collection.find_one({'_id': task_id}) | ||
| if obj: | ||
| if self.app.conf.find_value_for_key('extended', 'result'): | ||
| return self.meta_from_decoded({ |
There was a problem hiding this comment.
you can check this file https://github.com/celery/celery/blob/main/t/unit/backends/test_mongodb.py and other back end tests in https://github.com/celery/celery/blob/main/t/unit/backends/ folder
Added test method test_get_task_meta_for_result_extended.
|
thanks lets wait for the CI |
|
So did it pas CI processing? Is there anything else that I have to do? |
|
CI is passing |
|
thanks |
Fix for bug report: #8387.
backend.get_task_meta ignores the result_extended config parameter in mongodb backend
Note: Before submitting this pull request, please review our contributing
guidelines.
Description