-
Notifications
You must be signed in to change notification settings - Fork 44
Add mongodb job storage. #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Bibo-Joshi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the PR! IISC the addition basically does the same as sqlite jobstore, just with MongeDBJobStore as base class - is that right? I wonder if one could find a more general approach that accepts any JobStore implementation class as input and applies the changes to add/update_job as detailed below 🤔
|
Hi, I think it could be done as Mixin class, but still every Storage should be separate class as in original |
Bibo-Joshi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates! I like the new unified structure 👍 IISC this now supersedes #73?
What I'm missing is unit tests for the mongodb jobstore. I guess it should be possible to parametrize the jq fixture in the ptb_sqlachlemy_jobstore in such a way that the tests run once with the sqlalchemy JS and once with the MongoDB jobstore.
|
Spent 3 hours trying parametrize the fixtures, now I hate pytest. It's just not working like that, also would need to mock the mongodb, so basically there's nothing to test as the basic functionality was tested. So sorry, wouldn't do. P.S. What is IISC? |
|
@Holmes555 IISC = If I see correctly |
|
An example of a parametrized fixture can be seen here: I'm sure that providing a full-fledged mock of the mongodb is a lot of work and beyond the scope of this PR. however, we only want to ensure that Another note: Both the mongodb and the sqlalchemy jobstores define |
|
Even with fixture parametrize I would need to mock the mongodb, and as I said the workarounds are the same as in For the |
Let me put it that way: Without explicit tests for
Ah, I had missed that, thanks! |
Bibo-Joshi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for taking the time to find a solution for the tests 👍
Add
PTBMongoDBJobStoreasPTBSQLAlchemyJobStoreexample.Fixed bug the same way as in PR.
It was tested manually.