1. 15 8月, 2015 1 次提交
  2. 13 8月, 2015 2 次提交
  3. 11 8月, 2015 1 次提交
  4. 06 8月, 2015 1 次提交
  5. 04 8月, 2015 1 次提交
    • J
      Fixes #20799 · 3860e6b2
      Johannes Opper 提交于
      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.
      3860e6b2
  6. 29 6月, 2015 1 次提交
  7. 25 5月, 2015 1 次提交
  8. 08 5月, 2015 4 次提交
  9. 05 5月, 2015 1 次提交
  10. 04 5月, 2015 1 次提交
  11. 23 4月, 2015 1 次提交
  12. 20 4月, 2015 3 次提交
    • M
      Only *configure* the queue in setup; DB creation must come later · 8b09b454
      Matthew Draper 提交于
      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.
      8b09b454
    • M
      Shuffle a few things in aid of easier debugging · 41ae432f
      Matthew Draper 提交于
      * 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
      41ae432f
    • M
      Fix sidekiq test order dependency · 2ca8545e
      Matthew Draper 提交于
      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.
      2ca8545e
  13. 15 4月, 2015 1 次提交
    • T
      avoid double initialization error caused to sidekiq · b126e7aa
      Takumi IINO 提交于
      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.
      b126e7aa
  14. 24 3月, 2015 2 次提交
  15. 17 3月, 2015 1 次提交
    • B
      Closes rails/rails#18864: Renaming transactional fixtures to transactional tests · 09658635
      Brandon Weiss 提交于
      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.
      09658635
  16. 12 3月, 2015 3 次提交
  17. 07 3月, 2015 1 次提交
  18. 06 3月, 2015 1 次提交
  19. 24 2月, 2015 1 次提交
    • T
      `ActiveJob::QueueAdapters::TestAdapter` is now a singleton · 802f855e
      Tamir Duberstein 提交于
      Since `ActiveJob::TestHelper` globally sets
      `ActiveJob::Base.queue_adapter` on setup, there is no benefit in
      instantiating a new `TestAdapter` per tests. The original rationale was
      to allow parallel tests to run without interference, but since they'd
      all mutate the global `ActiveJob::Base.queue_adapter`, that was never
      realized.
      802f855e
  20. 22 2月, 2015 1 次提交
  21. 07 2月, 2015 1 次提交
    • M
      Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on · e818f657
      Michael Ryan 提交于
      type.
      
      This allows specific jobs to be tested, while preventing others from
      being performed unnecessarily.
      
      Example:
      
          def test_hello_job
            assert_performed_jobs 1, only: HelloJob do
              HelloJob.perform_later('jeremy')
              LoggingJob.perform_later
            end
          end
      
      An array may also be specified, to support testing multiple jobs.
      
      Example:
      
          def test_hello_and_logging_jobs
            assert_nothing_raised do
              assert_performed_jobs 2, only: [HelloJob, LoggingJob] do
                HelloJob.perform_later('jeremy')
                LoggingJob.perform_later('stewie')
                RescueJob.perform_later('david')
              end
            end
          end
      
      Fixes #18802.
      
      Trim space and document :only option.
      e818f657
  22. 01 2月, 2015 1 次提交
  23. 31 1月, 2015 1 次提交
    • S
      Allow keyword arguments to work with ActiveJob · 31085a5c
      Sean Griffin 提交于
      Unfortunately, the HashWithIndifferent access approach is insufficient
      for our needs. It's perfectly reasonable to want to use keyword
      arguments with Active Job, which we will see as a symbol keyed hash. For
      Ruby to convert this back to keyword arguments, it must deserialize to a
      symbol keyed hash.
      
      There are two primary changes to the serialization behavior. We first
      treat a HWIA separately, and mark it as such so we can convert it back
      into a HWIA during deserialization.
      
      For normal hashes, we keep a list of all symbol keys, and convert them
      back to symbol keys after deserialization.
      
      Fixes #18741.
      31085a5c
  24. 23 1月, 2015 1 次提交
  25. 08 1月, 2015 2 次提交
  26. 05 1月, 2015 1 次提交
  27. 30 12月, 2014 1 次提交
    • C
      ActiveJob testing improvements · 8a73f4b5
      Cristian Bica 提交于
      1. The :test adapter wasn't going through a full cycle of
      serialize/deserialize when performing jobs. Now it does
      2. Regular AJ tests were not run for the :test adapter. Now they are
      3. ActiveJob::TestHelper uses assert_valid_keys but doesn’t requires
      the file that implements that method. Now it does
      8a73f4b5
  28. 29 12月, 2014 1 次提交
  29. 13 12月, 2014 1 次提交
  30. 05 12月, 2014 1 次提交