aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test
Commit message (Collapse)AuthorAgeFilesLines
* Improve DelayedJob wrapper loggingJacek Lachowski2017-11-241-0/+7
| | | | | | | | ActiveJob wraps every adapter into its own class, that is later passed into DelayedJob which is responsible for displaying all the logs. This change improves the logging so we can easily trace executed jobs and see meaningful information in the logs.
* Make sidekiq and resque integration tests work in CIyuuji.yaginuma2017-11-132-9/+1
| | | | | | | | | | Since 8f2490b, the integration test of sidekiq and resque is not working in CI. https://travis-ci.org/rails/rails/jobs/301276197#L2055 https://travis-ci.org/rails/rails/jobs/301276197#L2061 Because 8f2490b removed password from `redis-server`. So must also remove passwords from these tests.
* Return a non zero code when can not connect to redis in CIyuuji.yaginuma2017-11-132-2/+4
|
* `rails new` runs `rails active_storage:install`bogdanvlviv2017-11-062-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omit `rails activestorage:install` for jdbcmysql, jdbc and shebang tests AppGeneratorTest#test_config_jdbcmysql_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/mysql_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_config_jdbc_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/jdbc_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_shebang_is_added_to_rails_file /home/ubuntu/.rbenv/versions/2.4.1/bin/ruby: no Ruby script found in input (LoadError) Prevent PendingMigrationError in tests * Run `bin/rails db:migrate RAILS_ENV=test` in test_cases before start tests to prevent PendingMigrationError * FileUtils.rm_r("db/migrate") * --skip-active-storage Fix failed tests in `railties/test/railties/engine_test.rb` Related to #30111 Imporve `SharedGeneratorTests#test_default_frameworks_are_required_when_others_are_removed` - Explicitly skip active_storage - Ensure that skipped frameworks are commented - Ensure that default frameworks are not commented Fix error `Errno::ENOSPC: No space left on device - sendfile` Since `rails new` runs `rails active_storage:install` that boots an app. Since adding Bootsnap 0312a5c67e35b960e33677b5358c539f1047e4e1 during booting an app, it creates the cache: 264K tmp/cache/bootsnap-load-path-cache 27M tmp/cache/bootsnap-compile-cache * teardown_app must remove app
* removed unnecessary returnsShuhei Kitagawa2017-10-281-1/+1
|
* Merge pull request #30750 from k2nr/fix-active-jobRyuta Kamizono2017-10-132-2/+2
|\ | | | | Yield with an error instance instead of error class
| * Test exception message to ensure an exception instance is yieldedKazunori Kajihiro2017-10-132-2/+2
| |
* | redis-rb 4.0 supportJeremy Daer2017-10-081-7/+4
|/ | | | | | | | * Use `gem 'redis', '~> 4.0'` for new app Gemfiles * Loosen Action Cable redis-rb dep to `>= 3.3, < 5` * Bump redis-namespace for looser Redis version dep * Avoid using the underlying `redis.client` directly * Use `Redis.new` instead of `Redis.connect`
* Use `ActiveJob::Base.queue_adapter_name` to get adapter nameyuuji.yaginuma2017-08-171-3/+1
| | | | Since 673606a, it holds adapter name.
* Wait for the Delayed Job worker thread to finishMatthew Draper2017-08-131-0/+1
|
* Use File::NULL instead of "/dev/null"Kazuhiro NISHIYAMA2017-07-311-1/+1
|
* Use `ArgumentError` instead of own error classyuuji.yaginuma2017-07-201-17/+17
| | | | | If the argument is invalid, I think that it is more intuitive to use `ArgumentError` than its own error class.
* Add `except` option for ActiveJob::TestHelper methodsposthumanism2017-07-181-0/+359
|
* [Active Job] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-1165-0/+65
|
* Make sidekiq and resque integration tests work in CIyuuji.yaginuma2017-07-102-1/+9
| | | | | | | | | Since f55ecc6, the integration test of sidekiq and resque is not working in CI. https://travis-ci.org/rails/rails/jobs/251783876 Because f55ecc6 required a password to access redis. Therefore, handling by passing passwords when connecting to redis.
* Use frozen-string-literal in ActiveJobKir Shatrov2017-07-0965-0/+65
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-0265-65/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-0165-0/+65
|
* ActiveJob::Core#serialize stores provider_job_id (fixes #26581).utilum2017-06-271-0/+8
|
* Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-031-2/+1
|
* 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.
* Define path with __dir__bogdanvlviv2017-05-233-3/+3
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* 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-272-1/+8
| | | | | | | | | | | | | | | | | | | | 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.
* remove `ActiveSupport.halt_callback_chains_on_return_false` from everywhereyuuji.yaginuma2017-02-081-1/+0
|
* correctly set test adapter when configure the queue adapter on a per job ↵Yuji Yaginuma2017-01-313-0/+21
| | | | | | | | | | | | (#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
* 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.
* assert_enqueued_jobs with queue optionMichael Elfassy2017-01-181-0/+21
|
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-053-3/+3
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* remove useless importSnowmanzzz(Zhengzhong Zhao)2016-12-301-2/+0
|
* "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-252-3/+3
|
* Privatize unneededly protected methods in Active Job testsAkira Matsuda2016-12-242-2/+2
|
* Output adapter being tested.utilum2016-12-121-0/+1
|
* 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-2910-15/+15
|
* removes requires already present in active_support/railsXavier Noria2016-10-271-1/+0
|
* 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-053-0/+16
| | | | | | `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
|
* Added instance variable `@queue` to JobWrapper.InJung Chung2016-08-191-0/+7
| | | | | This will fix issues in [resque-scheduler](https://github.com/resque/resque-scheduler) `#job_to_hash` method, so we can use `#enqueue_delayed_selection`, `#remove_delayed` method in resque-scheduler smoothly.
* Yield the job instance so you have access to things like `job.arguments` on ↵David Heinemeier Hansson2016-08-162-3/+3
| | | | the custom logic after retries fail
* 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-082-2/+2
| | | | | | | | | 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-073-4/+0
|
* applies remaining conventions across the projectXavier Noria2016-08-063-3/+0
|