-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
[17.0][MIG] queue_job + test_queue_job: Migration to 17.0 #593
Conversation
Currently translated at 3.7% (5 of 135 strings) Translation: queue-15.0/queue-15.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/es/
Currently translated at 100.0% (135 of 135 strings) Translation: queue-15.0/queue-15.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/es/
Currently translated at 83.2% (114 of 137 strings) Translation: queue-15.0/queue-15.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/zh_CN/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: queue-16.0/queue-16.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/
It can still be activated by overriding a method.
…n test if addon not loaded. TT35938
…se_sparse_field) from server_wide_modules. OCA#443 (comment)
Co-authored-by: Stéphane Bidoul <[email protected]>
Current situation: * multiple keys for no good reason * half baked: not all of them used everywhere * no centralization * poor naming With this change we'll have: * 1 and only one key to disable via ctx: ``queue_job__no_delay`` * 1 and only one key to disable via os env: ``QUEUE_JOB__NO_DELAY`` * backward compatibility with deprecation for old keys
The trap_jobs() test helper accepts any model/recordset as long as the job function is the same, which is not enough to verify that the job has been delayed on the expected recordset or model. Tested job functions are "bound methods" so we can compare their `__self__`. Example of assertion that would be valid: partner = self.env["res.partner"].create({"name": "foo"}) with trap_jobs() as trap: partner.with_delay().do_something(42) trap.assert_enqueued_job( self.env["res.partner"].do_something, args=(42,) ) trap.assert_jobs_count(1, only=self.env["res.partner"].do_something) Now, it would fail with an error message like: E AssertionError: Job <res.partner()>.do_something(42) with properties (channel=root.test, description=Do something, eta=15, identity_key=<function identity_exact at 0x7f01bfb54cb0>, max_retries=1, priority=15) was not enqueued. E Actual enqueued jobs: E * <res.partner(64,)>.do_something(42) with properties (priority=15, max_retries=1, eta=15, description=Do something, channel=root.test, identity_key=<function identity_exact at 0x7f01bfb54cb0>)
Currently translated at 100.0% (13 of 13 strings) Translation: queue-16.0/queue-16.0-test_queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_queue_job/es/
1. In production, a job which is waiting dependencies or which has started, but not completed, should not be repeated if the identity_key matches. 2. In tests, the mock queue handler is now enhanced to allow better mimicking of the identity_key blocks from production. 3. In tests, the mock queue handler now clears the enqueued jobs after performing them, to better reproduce what a production environment would do.
046275d
to
686691b
Compare
fixed, tks. |
Can it be merged? Or smth else is missing? |
@guewen can we help somehow to finish migration of this module? |
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 your work!
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at a70fda8. Thanks a lot for contributing to OCA. ❤️ |
@pedrobaeza can you (or who is responsible?) publish it on Odoo App store? |
Someone from board should do it. |
I can have a look |
/ocabot migration test_queue_job |
Ref: BSRD-729