| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| | |
Execution of `assert_performed_jobs`, and `assert_no_performed_jobs`
without a block should respect passed `:except`, `:only`, and `:queue` options.
|
| |
| |
| |
| |
| | |
Note that it removes changelog entry of #33265 since the entry in this commits
includes that too.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the `:queue` option is specified, then only the job(s) enqueued to a specific
queue will not be performed.
Example:
```
def test_assert_no_performed_jobs_with_queue_option
assert_no_performed_jobs queue: :some_queue do
HelloJob.set(queue: :other_queue).perform_later("jeremy")
end
end
```
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the `:queue` option is specified, then only the job(s) enqueued to a specific
queue will be performed.
Example:
```
def test_assert_performed_jobs_with_queue_option
assert_performed_jobs 1, queue: :some_queue do
HelloJob.set(queue: :some_queue).perform_later("jeremy")
HelloJob.set(queue: :other_queue).perform_later("bogdan")
end
end
```
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Set
````
queue_adapter.perform_enqueued_jobs = true
queue_adapter.perform_enqueued_at_jobs = true
queue_adapter.filter = only
queue_adapter.reject = except
queue_adapter.queue = queue
```
if block given.
Execution of `flush_enqueued_jobs` doesn't require that.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the `:queue` option is specified, then only the job(s) enqueued to
a specific queue will be performed.
Example:
```
def test_perform_enqueued_jobs_with_queue
perform_enqueued_jobs queue: :some_queue do
MyJob.set(queue: :some_queue).perform_later(1, 2, 3) # will be performed
HelloJob.set(queue: :other_queue).perform_later(1, 2, 3) # will not be performed
end
assert_performed_jobs 1
end
```
Follow up #33265
[bogdanvlviv & Jeremy Daer]
|
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, the execution count increments after deserializes arguments.
Therefore, if an error occurs with deserialize, it retries indefinitely.
In order to prevent this, the count is moved before deserialize.
Fixes #33344.
|
| |
| |
| |
| | |
Follow up #33626
|
| |
| |
| |
| | |
Performs all of the jobs that have been enqueued up to this point in the test.
|
|/ |
|
|
|
|
|
| |
http links will be redirected to the https version, but still better to
just directly link to the https version.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
It breaks Active Job when run in isolation. E.g. bin/test test/cases/logging_test.rb:
https://travis-ci.org/rails/rails/jobs/398779028
Consider Rafaels suggestion of reviewing the eager loading instead:
https://github.com/rails/rails/pull/33234#issuecomment-401027419
This reverts commit cb0fdaacb277bd0595bfd73178329922aa24477e, reversing
changes made to a0a1abb3c7942084111d87ae95837a83bcc794f6.
|
|
|
|
|
|
|
|
|
|
|
| |
It can be asserted that no jobs are enqueued to a specific queue:
```ruby
def test_no_logging
assert_no_enqueued_jobs queue: 'default' do
LoggingJob.set(queue: :some_queue).perform_later
end
end
```
|
|\
| |
| | |
Fix Ruby warnings tickled by the test suite
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
Rename `in_block_job` to `enqueued_job` since this variable can refer not only
to jobs that were created in the block.
See #33258.
Return back accidentally removed test to activejob/test/cases/test_helper_test.rb
See #33258.
Fix name of tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example of `assert_enqueued_with` with no block
```ruby
def test_assert_enqueued_with
MyJob.perform_later(1,2,3)
assert_enqueued_with(job: MyJob, args: [1,2,3], queue: 'low')
MyJob.set(wait_until: Date.tomorrow.noon).perform_later
assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon)
end
```
Example of `assert_enqueued_email_with` with no block:
```ruby
def test_email
ContactMailer.welcome.deliver_later
assert_enqueued_email_with ContactMailer, :welcome
end
def test_email_with_arguments
ContactMailer.welcome("Hello", "Goodbye").deliver_later
assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"]
end
```
Related to #33243
|
|
|
|
|
|
|
|
|
| |
evopark/fix/action-mailer-test-helper-no-block"
This reverts commit 9d6bbf4e0b2d2b2e2fccd87a778de2893bb28a25, reversing
changes made to 5a1ea09062eaed78e21253a128d433a1beb745ad.
This method only works with block.
|
|
|
|
|
|
| |
The documentation for assert_enqueued_email_with states that it's
supposed to work without a block yet it calls assert_enqueued_with
which doesn't check whether a block was passed before calling `yield`
|
| |
|
| |
|
|
|
|
|
|
|
| |
Since it is changes of the public API, it seems valuable to add a mention
about it to the changelog file.
Follow up 3110caecbebdad7300daaf26bfdff39efda99e25
|
| |
|
|
|
|
|
|
|
|
| |
`retry_on`
[ci skip]
Follow up #32854 and ba07b5fc12a740d41d288bea6347f15f4948483c.
|
| |
|
| |
|
|
|
|
| |
Also normalize AJ task use t, like all other Rails test tasks.
|
|
|
|
| |
Follows the change from 6fac9bd, so the naming is consistent.
|
|
|
|
|
|
|
|
|
|
|
| |
`discard_on`
I'm not sure what originally wanted to pass to the argument.
However, as long as see the document added along with the commit, it seems just
to be mistaken that trying to pass the error instance.
https://github.com/rails/rails/pull/30622/files#diff-59beb0189c8c6bc862edf7fdb84ff5a7R64
Fixes #32853
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a job was just deserialized `arguments` is `nil` and the serialized
arguments are in the `@serialized_arguments` variable. If we try to
serialize this job again the arguments are going to be `nil` instead of
what was serialized.
The test we had was not checking this case because it was deserializing
the job in the same object that had the arguments.
To fix this, when the `@serialized_arguments` are present we return it
instead of the result of the `arguments` serialized.
|
|
|
|
| |
In the previous code incorrectly removes intermediate words.
|
| |
|
| |
|
|
|
|
|
|
| |
Reasons are that the Qu gem wasn't compatible since Rails 5.1,
gem development was stopped in 2014 and maintainers have
confirmed its demise. See issue #32273
|
| |
|
|
|
|
|
|
| |
We only add the header when releasing to avoid some conflicts.
[ci skip]
|
|
|
|
|
|
|
|
| |
- Add missing dots.
- Remove reference to itself on GitHub.
Usually, we add references to fixed issues only in a changelog.
Follow up #32223
|
| |
|
|
|
|
|
|
| |
Record what was the current timezone in effect when the job was
enqueued and then restore when the job is executed in same way
that the current locale is recorded and restored.
|
|\
| |
| | |
Improve ActiveJob custom argument serializers #30941
|
| | |
|
| |
| |
| |
| |
| |
| | |
Add `:nodoc:` to `ActiveJob::Serializers`
Add `:doc:` to `ActiveJob::Serializers::ObjectSerializer#klass`
Express `ActiveJob::Serializers::ObjectSerializer#klass` as private method
|
| |
| |
| |
| |
| | |
The serializer serializes an instance of `ActiveSupport::TimeWithZone`.
The serializer deserializes value to `ActiveSupport::TimeWithZone` if possible.
|
| | |
|
|/
|
|
|
|
| |
Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug.
References #32028
|
|\
| |
| | |
Fix custome serializer setting
|
| |
| |
| |
| |
| |
| |
| |
| | |
The serializer should be set up in `after_initialize` so that it work
properly even if the user specifies serializer with initializers.
Also, since `custom_serializers` is `Array`, it needs to be flattened
before setting the value.
|