aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/support
Commit message (Collapse)AuthorAgeFilesLines
* Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-031-2/+1
|
* Define path with __dir__bogdanvlviv2017-05-232-2/+2
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* make backburner integration test to workyuuji.yaginuma2017-01-281-2/+2
| | | | | | | | | | | | | Currently, backburner integration test is not running on CI. https://travis-ci.org/rails/rails/jobs/196005322#L610 Using `Backburner::Worker.connection` to check whether beanstalkd is running. But `Backburner::Worker.connection` was removed in backburner 1.2.0. https://github.com/nesquena/backburner/commit/81fde499c2263abe8dedee59a3d0e03e92d72627 Therefore, this check process always becomes false, so the test is no longer done. I fixed it so that check processing is done correctly.
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-1/+1
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Privatize unneededly protected methods in Active Job testsAkira Matsuda2016-12-242-2/+2
|
* Avoid race condition in AJ integration testsMatthew Draper2016-11-302-1/+3
| | | | Make sure the file doesn't exist until we've finished writing it.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-296-11/+11
|
* removes requires already present in active_support/railsXavier Noria2016-10-271-1/+0
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-7/+7
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* 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-1/+0
|
* applies remaining conventions across the projectXavier Noria2016-08-062-2/+0
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-063-3/+1
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-3/+2
|
* modernizes hash syntax in activejobXavier Noria2016-08-062-11/+11
|
* applies new string literal convention in activejob/testXavier Noria2016-08-0616-50/+50
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Chomp: prefer String#chomp where we can for a clarity boostlvl0nax2016-04-291-1/+3
| | | | | | Closes #24766, #24767 Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* Merge pull request #23966 from ↵Jeremy Daer2016-03-011-1/+2
|\ | | | | | | | | jeremy/activejob/pare-down-async-adapter-for-low-footprint-dev Active Job: pare down async adapter for low footprint dev
| * Active Job: smaller footprint for the dev/test async adapterJeremy Daer2016-02-291-1/+2
| | | | | | | | | | Use one shared worker pool for all queues with 0-#CPU workers rather than separate pools per queue with 2-10*#CPU workers each.
* | - Updating the dummy app template to have rails_command instead of rakeMohit Natoo2016-03-011-1/+1
|/
* Remove celluloid from the GemfileRafael Mendonça França2016-01-271-3/+1
|
* Fix race condition testing for job execution orderWill Jessop2015-11-232-6/+17
| | | | | | | | | | | | | | | On most filesystems file ctime is limited to 1 second granularity, which means that on faster computers multiple simple jobs (for instance dummy TestJob) can finish within the same second. The execution order test in ActiveJob integration tests relies on multiple TestJobs writing files then comparing the ctime. As a result integration tests would sometimes fail as the ctime of the files written by these TestJobs could have coincidental ctimes making the comparison for job order fail. This commit adds a far more precise execution time (to the extent that the Ruby Time class allows) to the file created by TestJob, and updates the execution order assertion to use it, removing the race condition.
* Merge pull request #19425 from wvengen/feature/activejob-priority-masterRafael Mendonça França2015-09-252-2/+7
|\ | | | | Add job priorities to ActiveJob
| * Add job priorities to ActiveJobwvengen2015-09-172-2/+7
| |
* | Use Sidekiq.options to set initial waitAndrew White2015-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | The INITIAL_WAIT constant has moved to the Sidekiq::Poller class but rather than setting the constant directly we can override it via the `:poll_interval_average` option. This was causing random build failures because the test was waiting for 10 seconds for the job to execute but the initial wait was a random value between 10 and 15 seconds.
* | Run `rake db:migrate` for all Active Job integration testsAndrew White2015-09-211-1/+2
| | | | | | | | | | | | If db/schema.rb doesn't exist then we get warnings from the dummy Rails application so run it for all adapters even if they're not using the database to store jobs.
* | Added new lines to run title for easy log readinghiren mistry2015-09-191-1/+1
|/
* Initial implementation of ActiveJob AsyncAdapter.Jerry D'Antonio2015-08-251-0/+9
|
* use `average_scheduled_poll_interval` option instead of deprecated ↵yuuji.yaginuma2015-08-151-1/+1
| | | | | | | | | | `poll_interval` this removes the following warning: ``` DEPRECATION: `config.poll_interval = 0.5` will be removed in Sidekiq 4. Please update to `config.average_scheduled_poll_interval = 0.5`. ```
* Fixes #20799Johannes Opper2015-08-042-1/+9
| | | | | | | | | | | | | | | | | | | | | | When `#perform_later` is called the locale isn't stored on the queue, which results in a locale reset when the job is performed. An example of the problem: I18n.locale = 'de' HelloJob.perform_now # german message, correct but I18n.locale = 'de' HelloJob.perform_later # english message, incorrect This PR attaches the current I18n.locale to every job during the serialization process. It is then restored during deserialization and used to perform the job with the correct locale. It falls back to the default locale if no serialized locale is found in order to provide backward compatibility with previously stored jobs. It is not necessary to clear the queue for the update.
* Provide provider_job_id to qu adapter.Kevin Deisz2015-05-071-2/+2
| | | | Further work to provide provider_job_id for queue adapters.
* Do not use named queues for que adapterRafael Mendonça França2015-05-031-1/+1
| | | | See #19498
* Merge pull request #19498 from chanks/activejob-que-remove-named-queuesRafael Mendonça França2015-05-031-1/+5
|\ | | | | ActiveJob: Stop using Que's named queues.
| * Stop using Que's named queues in its ActiveJob adapter.Chris Hanks2015-03-241-1/+5
| |
* | Only *configure* the queue in setup; DB creation must come laterMatthew Draper2015-04-202-21/+25
| | | | | | | | | | | | | | | | | | setup gets called from the initializer, so it happens more than once in a test run. Trying to drop the database again after the first process is connected is.. ineffective. And entirely pointless. Instead, defer creating the database to start_workers -- which only happens once, right before we start doing anything real.
* | Shuffle a few things in aid of easier debuggingMatthew Draper2015-04-201-20/+36
| | | | | | | | | | | | | | * Don't swallow output -- if there is any, it's probably useful * Wait for the process to finish * Use IPC instead of a sleep * No need for a pidfile
* | Fix sidekiq test order dependencyMatthew Draper2015-04-201-0/+3
| | | | | | | | | | | | | | | | Requiring sidekiq/testing changes stuff, so we need to counteract that after we do so. And given its potential to confuse things, let's do it up front, at a predictable point.
* | avoid double initialization error caused to sidekiqTakumi IINO2015-04-141-13/+34
|/ | | | | | Sidekiq::CLI#boot_system require "#{dummy_app_path}/config/environment.rb". But this file has already been required in'test/support/integration/helper.rb'. This patch will change to use Sidekiq::Launcher directly.
* Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* `ActiveJob::QueueAdapters::*` are no longer singletonsTamir Duberstein2015-03-111-2/+2
|
* Fixed ActiveJob integration testsCristian Bica2015-03-052-2/+4
|
* Changed the AJADAPTER to AJ_ADAPTERJeroen van Baarsen2015-02-223-3/+3
| | | | | | | * This allows for easier reading, since those are two words, so they should be split by _ Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846robertomiranda2015-01-311-1/+1
| | | | ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
* redis 3.2.0 doesn't allow tcp protocol anymoreRafael Mendonça França2014-12-131-1/+1
| | | | Use redis protocol
* Merge pull request #17825 from aripollak/fix-activejob-sidekiq-integrationRafael Mendonça França2014-12-041-1/+2
|\ | | | | | | | | | | | | Fix Sidekiq ActiveJob integration setup Conflicts: activejob/test/support/integration/adapters/sidekiq.rb
| * Fix Sidekiq ActiveJob integration setupAri Pollak2014-11-281-1/+2
| | | | | | | | | | | | * .connect on a Redis connection wasn't valid * Reset logger after we're done testing for redis connection to avoid "closed stream" error when starting server for real from a fork
* | Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-292-4/+2
|/
* - Removed unused variable warnings from ActiveJob AdaptersVipul A M2014-10-195-5/+5
|
* Make AJ integration tests much less verboseMatthew Draper2014-09-278-26/+14
| | | | In passing, avoid a blind retry in QC: instead, just fix the problem.
* ActiveJob Integration TestsCristian Bica2014-09-1114-0/+521
|