Skip to content

Commit

Permalink
[BOT] post-merge updates
Browse files Browse the repository at this point in the history
  • Loading branch information
OCA-git-bot committed Sep 4, 2024
1 parent 03ca33d commit ee55b99
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ addon | version | maintainers | summary
[base_export_async](base_export_async/) | 14.0.1.0.0 | | Asynchronous export with job queue
[base_import_async](base_import_async/) | 14.0.1.0.2 | | Import CSV files in the background
[export_async_schedule](export_async_schedule/) | 14.0.1.0.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Generate and send exports by emails on a schedule
[queue_job](queue_job/) | 14.0.3.6.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Job Queue
[queue_job](queue_job/) | 14.0.3.7.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Job Queue
[queue_job_batch](queue_job_batch/) | 14.0.1.0.1 | | Job Queue Batch
[queue_job_context](queue_job_context/) | 14.0.1.0.1 | [![AshishHirapara](https://github.com/AshishHirapara.png?size=30px)](https://github.com/AshishHirapara) | Queue Job, prepare context before enqueue keys
[queue_job_cron](queue_job_cron/) | 14.0.2.0.0 | | Scheduled Actions as Queue Jobs
[queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 14.0.1.0.2 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Run jobs without a dedicated JobRunner
[queue_job_subscribe](queue_job_subscribe/) | 14.0.1.0.0 | | Control which users are subscribed to queue job notifications
[test_base_import_async](test_base_import_async/) | 14.0.1.0.1 | | Test suite for base_import_async. Normally you don't need to install this.
[test_queue_job](test_queue_job/) | 14.0.3.3.0 | | Queue Job Tests
[test_queue_job](test_queue_job/) | 14.0.3.4.0 | | Queue Job Tests
[test_queue_job_batch](test_queue_job_batch/) | 14.0.1.0.0 | | Test Job Queue Batch

[//]: # (end addons)
Expand Down
15 changes: 7 additions & 8 deletions queue_job/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Job Queue
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:86b15d0268936122aebe59dce2eb55468df62ddd7cd3c578dd4c3af1a20621aa
!! source digest: sha256:e11d06541a5a139c82b353f28c24413e9d58961fa44ea00f5dba69f71883224b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
Expand Down Expand Up @@ -408,13 +408,12 @@ Example:
When you are developing (ie: connector modules) you might want
to bypass the queue job and run your code immediately.

To do so you can set `QUEUE_JOB_NO_DELAY=1` in your enviroment.
To do so you can set `QUEUE_JOB__NO_DELAY=1` in your enviroment.

**Bypass jobs in tests**

When writing tests on job-related methods is always tricky to deal with
delayed recordsets. To make your testing life easier,
or to run a delayed action immediately,
delayed recordsets. To make your testing life easier
you can set `queue_job__no_delay=True` in the context.

Tip: you can do this at test case level like this
Expand Down Expand Up @@ -531,15 +530,15 @@ If you prefer, you can still test the whole thing in a single test, by calling
When you are developing (ie: connector modules) you might want
to bypass the queue job and run your code immediately.
To do so you can set ``TEST_QUEUE_JOB_NO_DELAY=1`` in your environment.
To do so you can set ``QUEUE_JOB__NO_DELAY=1`` in your environment.
.. WARNING:: Do not do this in production
**Execute jobs synchronously in tests**
You should use ``trap_jobs``, really, but if for any reason you could not use it,
and still need to have job methods executed synchronously in your tests, you can
do so by setting ``test_queue_job_no_delay=True`` in the context.
do so by setting ``queue_job__no_delay=True`` in the context.
Tip: you can do this at test case level like this
Expand All @@ -550,7 +549,7 @@ Tip: you can do this at test case level like this
super().setUpClass()
cls.env = cls.env(context=dict(
cls.env.context,
test_queue_job_no_delay=True, # no jobs thanks
queue_job__no_delay=True, # no jobs thanks
))
Then all your tests execute the job methods synchronously without delaying any
Expand All @@ -560,7 +559,7 @@ In tests you'll have to mute the logger like:
@mute_logger('odoo.addons.queue_job.models.base')
.. NOTE:: in graphs of jobs, the ``test_queue_job_no_delay`` context key must be in at
.. NOTE:: in graphs of jobs, the ``queue_job__no_delay`` context key must be in at
least one job's env of the graph for the whole graph to be executed synchronously
Expand Down
2 changes: 1 addition & 1 deletion queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "Job Queue",
"version": "14.0.3.6.1",
"version": "14.0.3.7.0",
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license": "LGPL-3",
Expand Down
16 changes: 8 additions & 8 deletions queue_job/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Job Queue</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:86b15d0268936122aebe59dce2eb55468df62ddd7cd3c578dd4c3af1a20621aa
!! source digest: sha256:e11d06541a5a139c82b353f28c24413e9d58961fa44ea00f5dba69f71883224b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/14.0/queue_job"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-14-0/queue-14-0-queue_job"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/queue&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon adds an integrated Job Queue to Odoo.</p>
Expand Down Expand Up @@ -719,19 +719,19 @@ <h3><a class="toc-backref" href="#toc-entry-7">Configure default options for job
<p><strong>Bypass jobs on running Odoo</strong></p>
<p>When you are developing (ie: connector modules) you might want
to bypass the queue job and run your code immediately.</p>
<p>To do so you can set <cite>TEST_QUEUE_JOB_NO_DELAY=1</cite> in your enviroment.</p>
<p>To do so you can set <cite>QUEUE_JOB__NO_DELAY=1</cite> in your enviroment.</p>
<p><strong>Bypass jobs in tests</strong></p>
<p>When writing tests on job-related methods is always tricky to deal with
delayed recordsets. To make your testing life easier
you can set <cite>test_queue_job_no_delay=True</cite> in the context.</p>
you can set <cite>queue_job__no_delay=True</cite> in the context.</p>
<p>Tip: you can do this at test case level like this</p>
<pre class="code python literal-block">
<span class="nd">&#64;classmethod</span><span class="w">
</span><span class="k">def</span> <span class="nf">setUpClass</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span><span class="w">
</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setUpClass</span><span class="p">()</span><span class="w">
</span> <span class="bp">cls</span><span class="o">.</span><span class="n">env</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">env</span><span class="p">(</span><span class="n">context</span><span class="o">=</span><span class="nb">dict</span><span class="p">(</span><span class="w">
</span> <span class="bp">cls</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">context</span><span class="p">,</span><span class="w">
</span> <span class="n">test_queue_job_no_delay</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># no jobs thanks</span><span class="w">
</span> <span class="n">queue_job__no_delay</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># no jobs thanks</span><span class="w">
</span> <span class="p">))</span>
</pre>
<p>Then all your tests execute the job methods synchronously
Expand Down Expand Up @@ -827,23 +827,23 @@ <h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3>
<p><strong>Execute jobs synchronously when running Odoo</strong></p>
<p>When you are developing (ie: connector modules) you might want
to bypass the queue job and run your code immediately.</p>
<p>To do so you can set <tt class="docutils literal">TEST_QUEUE_JOB_NO_DELAY=1</tt> in your environment.</p>
<p>To do so you can set <tt class="docutils literal">QUEUE_JOB__NO_DELAY=1</tt> in your environment.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Do not do this in production</p>
</div>
<p><strong>Execute jobs synchronously in tests</strong></p>
<p>You should use <tt class="docutils literal">trap_jobs</tt>, really, but if for any reason you could not use it,
and still need to have job methods executed synchronously in your tests, you can
do so by setting <tt class="docutils literal">test_queue_job_no_delay=True</tt> in the context.</p>
do so by setting <tt class="docutils literal">queue_job__no_delay=True</tt> in the context.</p>
<p>Tip: you can do this at test case level like this</p>
<pre class="code python literal-block">
<span class="nd">&#64;classmethod</span><span class="w">
</span><span class="k">def</span> <span class="nf">setUpClass</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span><span class="w">
</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setUpClass</span><span class="p">()</span><span class="w">
</span> <span class="bp">cls</span><span class="o">.</span><span class="n">env</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">env</span><span class="p">(</span><span class="n">context</span><span class="o">=</span><span class="nb">dict</span><span class="p">(</span><span class="w">
</span> <span class="bp">cls</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">context</span><span class="p">,</span><span class="w">
</span> <span class="n">test_queue_job_no_delay</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># no jobs thanks</span><span class="w">
</span> <span class="n">queue_job__no_delay</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># no jobs thanks</span><span class="w">
</span> <span class="p">))</span>
</pre>
<p>Then all your tests execute the job methods synchronously without delaying any
Expand All @@ -853,7 +853,7 @@ <h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3>
&#64;mute_logger(‘odoo.addons.queue_job.models.base’)</blockquote>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">in graphs of jobs, the <tt class="docutils literal">test_queue_job_no_delay</tt> context key must be in at
<p class="last">in graphs of jobs, the <tt class="docutils literal">queue_job__no_delay</tt> context key must be in at
least one job’s env of the graph for the whole graph to be executed synchronously</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion test_queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Queue Job Tests",
"version": "14.0.3.3.0",
"version": "14.0.3.4.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": "LGPL-3",
"category": "Generic Modules",
Expand Down

0 comments on commit ee55b99

Please sign in to comment.