aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/cases
Commit message (Collapse)AuthorAgeFilesLines
...
* Removed string inquiry.Mohit Natoo2017-05-261-2/+2
| | | | | | fixed indentation. rebased with master.
* Provides friendlier way to access queue adapters of a job.Mohit Natoo2017-05-261-1/+6
| | | | - removed predicate method. Used only reader.
* Add missing requireyuuji.yaginuma2017-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this, unit test fails. ``` bundle exec ruby -w -Ilib:lib:test test/cases/logging_test.rb Using inline Run options: --seed 41246 # Running: SE......S.... Finished in 0.052938s, 245.5696 runs/s, 831.1585 assertions/s. 1) Error: LoggingTest#test_job_error_logging: NameError: uninitialized constant LoggingTest::RescueJob test/cases/logging_test.rb:130:in `rescue in test_job_error_logging' test/cases/logging_test.rb:129:in `test_job_error_logging' 13 runs, 44 assertions, 0 failures, 1 errors, 2 skips You have skipped tests. Run with --verbose for details. ```
* Add error logging to Active JobSteven Bull2017-03-271-0/+7
| | | | | | | | | | | | | | | | | | | | Active Job logging instrumentation is changed to log errors (with backtrace) when a job raises an exception in #perform. This improves debugging during development and test with the default configuration. Prior to Rails 5, the default development configuration ran jobs with InlineAdapter, which would raise exceptions to the caller and be shown in the development log. In Rails 5, the default adapter was changed to AsyncAdapter, which would silently swallow exceptions and log a "Performed SomeJob from Async..." info message. This could be confusing to a developer, as it would seem that the job was performed successfully. This patch removes the "Performed..." info message from the log and adds an error-level "Error performing SomeJob..." log message which includes the exception backtrace for jobs that raise an exception within the #perform method. It provides this behavior for all adapters.
* Revert #27850 following test breakage (#28427)David Heinemeier Hansson2017-03-151-11/+0
|
* Include JobID in all ActiveJob info logsBolek Kurowski2017-02-221-6/+6
| | | | | | | | | | Currently we provide the Job ID in logs only related to enqueuing a job. This adds the job id to the remaining ActiveJob logs when: - a job started performing - a job ended performing Providing the job id in those logs will ease searching logs by job id.
* correctly set test adapter when configure the queue adapter on a per job ↵Yuji Yaginuma2017-01-312-0/+18
| | | | | | | | | | | | (#26690) The `ActiveJob::TestHelper` replace the adapter to test adapter in `before_setup`. It gets the target class using the `descendants`, but if the test target job class is not loaded, will not be a replacement of the adapter. Therefore, instead of replacing with `before_setup`, modified to replace when setting adapter. Fixes #26360
* Append skipped jobs to enqueued_jobsAlexander Pauly2017-01-311-0/+11
| | | | | | | | | | Refactored ActiveJob TestAdapter Updated ActiveJob changelog Fixed typo in changelog Fixed formatting issue in changelog
* assert_enqueued_jobs with queue optionMichael Elfassy2017-01-181-0/+21
|
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-052-2/+2
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-252-3/+3
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-292-2/+2
|
* Uses queue adapter_method instead of ActiveJob::Base.queue_adapterGabi Stefanini2016-10-241-2/+2
| | | | Change ActiveJob::Base.queue_adapter to use queue_adapter method to make test code consistent.
* Removed deprecated support to passing the adapter class to .queue_adapterRafael Mendonça França2016-10-101-13/+0
|
* use `descendants` to get class that inherited `ActiveJob::Base`yuuji.yaginuma2016-09-051-0/+7
| | | | | | `subclasses` get only child classes. Therefore, if create a job common parent class as `ApplicationJob`, inherited class does not get properly.
* fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-011-1/+1
|
* Yield the job instance so you have access to things like `job.arguments` on ↵David Heinemeier Hansson2016-08-161-2/+2
| | | | the custom logic after retries fail
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-2/+0
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-15/+15
|
* modernizes hash syntax in activejobXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in activejob/testXavier Noria2016-08-0614-182/+182
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix tests against ActiveSupport::DurationsDavid Heinemeier Hansson2016-08-021-28/+45
|
* Please RubocupDavid Heinemeier Hansson2016-08-021-2/+2
|
* Not neededDavid Heinemeier Hansson2016-08-011-1/+0
|
* Allow for custom handling of exceptions that persist beyond the retry attemptsDavid Heinemeier Hansson2016-08-011-0/+5
|
* Add exponentially_longer and custom wait algorithmsDavid Heinemeier Hansson2016-08-011-0/+39
|
* Use descriptive exception namesDavid Heinemeier Hansson2016-08-011-14/+14
|
* Reraise instead of swallow exceptions that occur beyond the retry attemptsDavid Heinemeier Hansson2016-07-291-1/+1
|
* Satisfy pedantic rubocop whitespace detectionDavid Heinemeier Hansson2016-07-291-4/+4
|
* Add retry_on/discard_on for better exception handlingDavid Heinemeier Hansson2016-07-291-0/+47
|
* Fix AJ tests on ruby 2.4 being causes since classes are unified for Integer, ↵Vipul A M2016-07-091-1/+1
| | | | and we create test name nased on arg class. Append ar as well to the test name
* Fix jobs overriding AJ::Base#loggerJean Boussier2016-06-171-1/+6
|
* Provide the ability to override the queue adapter used by jobs underSteve Lounsbury2016-06-111-0/+12
| | | | | | | | | | | | | test. This PR adds a method called `queue_adapter_for_test` to `ActiveJob::TestHelper`. This method is expected to provide the queue adapter to be used for jobs under test. It maintains the current behaviour by defaulting to an instance of `ActiveJob::QueueAdapter::TestAdapter`. Tests that include `ActiveJob::TestHelper` or extend from `ActiveJob::TestCase` can provide a custom queue adapter by overriding `queue_adapter_for_test` in their class.
* Added more tests for reserved hash keys of ActiveJob::Arguments.Santosh Wadghule2016-03-171-6/+7
| | | | | | - Added tests for checking all reserved hash keys of ActiveJob::Arguments. - Moved unrelated code from the test to the correct place, i.e. newly created test.
* Add JSON round trip verification testcaseMike Perham2016-03-091-1/+16
|
* Job payload should be symmetric across JSON dump/loadMike Perham2016-03-091-3/+3
| | | Placing non-native JSON data types, like symbols, in the hash to serialize means that the deserialize method will return something different from what was serialized, a common bug and source of frustration for devs.
* Active Job: smaller footprint for the dev/test async adapterJeremy Daer2016-02-291-42/+0
| | | | | Use one shared worker pool for all queues with 0-#CPU workers rather than separate pools per queue with 2-10*#CPU workers each.
* Added support for bigdecimals in perform laterSiva Gollapalli2015-12-031-1/+1
|
* Added missing specs for not modifying queues when using AJ test helpersWojciech Wnętrzak2015-10-071-0/+21
|
* Merge pull request #21854 from morgoth/fix-serializing-at-option-in-aj-matchersYves Senn2015-10-051-4/+22
|\ | | | | | | Fixed serializing `:at` option for `assert_eqnueued_with` and `assert_performed_with`
| * Fixed serializing `:at` option for `assert_enqueued_with` and ↵Wojciech Wnętrzak2015-10-031-4/+16
|/ | | | `assert_performed_with`
* Support passing array to `assert_enqueued_jobs` in `:only` optionWojciech Wnętrzak2015-10-031-0/+18
|
* Merge pull request #19425 from wvengen/feature/activejob-priority-masterRafael Mendonça França2015-09-251-0/+47
|\ | | | | Add job priorities to ActiveJob
| * Add job priorities to ActiveJobwvengen2015-09-171-0/+47
| |
* | :hocho: TyposAkira Matsuda2015-09-211-1/+1
|/
* Properly log nested parameters to Active JobMarek Pieczyk2015-09-081-0/+8
| | | | Refactor arguments logging method for Active Job
* Initial implementation of ActiveJob AsyncAdapter.Jerry D'Antonio2015-08-251-0/+42
|
* Make assert_enqueued_with and assert_performed_with returns the matched jobJean Boussier2015-08-101-0/+22
|
* Add missing HelloJob require.Kasper Timm Hansen2015-08-051-0/+1
| | | | This way JobSerializationTest runs in isolation without errors.