Commit Graph

425 Commits

Author SHA1 Message Date
bogdanvlviv 0835527d6b
`rails new` runs `rails active_storage:install`
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 0312a5c67e
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
2017-11-06 21:29:14 +00:00
Shuhei Kitagawa c40b4428e6 removed unnecessary returns 2017-10-28 17:20:38 +09:00
Rafael França 280fb08fc7 Merge pull request #30955 from prathamesh-sonpatki/rm-changelog-entry
Remove CHANGELOG entry for the change that was backported to 5-1-stable [ci skip]
2017-10-23 13:09:41 -04:00
Prathamesh Sonpatki 95de5033cd
Remove CHANGELOT entry for the change that was backported to 5-1-stable [ci skip]
- It was backported in
  0eae8dd4b8
  and is present in Rails 5.1.3
2017-10-23 20:04:31 +05:30
Akira Matsuda feb6ecd313 [Active Job] require_relative => require
This basically reverts fef234f1f0
2017-10-21 22:48:28 +09:00
Ryuta Kamizono a254454deb Merge pull request #30750 from k2nr/fix-active-job
Yield with an error instance instead of error class
2017-10-13 12:58:48 +09:00
Kazunori Kajihiro 34d7b05d27 Test exception message to ensure an exception instance is yielded 2017-10-13 11:55:36 +09:00
Jeremy Daer 53c516d88d
redis-rb 4.0 support
* 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`
2017-10-08 15:37:54 -07:00
Kazunori Kajihiro 4a13c1e1d2 Yield with an error instance instead of error class 2017-09-29 18:15:56 +09:00
Yoshiyuki Hirano c7cd470bb3 Update activejob doc [ci skip] 2017-08-30 05:08:36 +09:00
Yoshiyuki Hirano 3a11e0586e Update MIT licenses link [ci skip] 2017-08-22 08:46:02 +09:00
Yoshiyuki Hirano 948c2c48df Use ssl in guide and comment [ci skip] 2017-08-19 08:23:37 +09:00
yuuji.yaginuma 0868cac0ef Use `ActiveJob::Base.queue_adapter_name` to get adapter name
Since 673606a, it holds adapter name.
2017-08-17 06:55:55 +09:00
Matthew Draper 788f46d486 Wait for the Delayed Job worker thread to finish 2017-08-13 22:03:40 +09:30
Kazuhiro NISHIYAMA 7f89d4e8bf Use File::NULL instead of "/dev/null" 2017-07-31 21:58:42 +09:00
yuuji.yaginuma 292be1b7de Use `ArgumentError` instead of own error class
If the argument is invalid, I think that it is more intuitive to use
`ArgumentError` than its own error class.
2017-07-20 07:38:26 +09:00
yuuji.yaginuma 2966f9598e Fix `warning: circular argument reference`
This fixes the following warnings:

```
rails/activejob/lib/active_job/test_helper.rb:119: warning: circular argument reference - except
rails/activejob/lib/active_job/test_helper.rb:166: warning: circular argument reference - except
```
2017-07-19 08:56:41 +09:00
posthumanism 4458b76756 Add `except` option for ActiveJob::TestHelper methods 2017-07-18 07:48:03 +09:00
Koichi ITO aa28c5ca65 [Active Job] `rubocop -a --only Layout/EmptyLineAfterMagicComment` 2017-07-11 13:12:32 +09:00
yuuji.yaginuma 46725b33a9 Make sidekiq and resque integration tests work in CI
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.
2017-07-10 07:42:17 +09:00
Kir Shatrov 14ece5e429 Use frozen-string-literal in ActiveJob 2017-07-09 20:50:52 +03:00
Akira Matsuda fef234f1f0 [Active Job] require => require_relative 2017-07-01 18:38:05 +09:00
Rafael França cf8c46938b Merge pull request #29588 from greysteil/add-gemspec-links
Add source code and changelog links to gemspecs
2017-06-28 11:24:02 -04:00
Grey Baker 3e6ce1cd69 Add source code and changelog links to gemspecs 2017-06-28 10:06:01 +01:00
utilum b58d73fc57 ActiveJob::Core#serialize stores provider_job_id (fixes #26581). 2017-06-27 07:08:55 +02:00
yuuji.yaginuma 12b3c60388 Remove needless gitignore
The dummy application is created under the tmp directory. Nothing is
created in the `test/dummy` directory.
40bdbce191/activejob/test/support/integration/helper.rb (L9)

I guess that this comment makes it unnecessary.
https://github.com/rails/rails/pull/16541#r16986711
2017-06-26 21:39:09 +09:00
bogdanvlviv 6673cf7071
Use `require_relative` instead of `require` with full path 2017-06-14 12:10:17 +03:00
Genadi Samokovarov b6b0c99ff3 Use mattr_accessor default: option throughout the project 2017-06-03 13:52:48 +03:00
David Heinemeier Hansson 1c275d812f Add option for class_attribute default (#29270)
* Allow a default value to be declared for class_attribute

* Convert to using class_attribute default rather than explicit setter

* Removed instance_accessor option by mistake

* False is a valid default value

* Documentation
2017-05-29 18:01:50 +02:00
yuuji.yaginuma 82e646f3d0 Bring back delayed_job to test list
`delayed_job_active_record` 4.1.2 supports Rails 5.1.
Ref: https://github.com/collectiveidea/delayed_job_active_record/pull/138
2017-05-28 21:39:18 +09:00
Mohit Natoo 4b04f56146 Removed string inquiry.
fixed indentation.

rebased with master.
2017-05-26 19:25:53 +07:00
Mohit Natoo 673606a962 Provides friendlier way to access queue adapters of a job.
- removed predicate method. Used only reader.
2017-05-26 19:00:34 +07:00
bogdanvlviv 40bdbce191
Define path with __dir__
".. with __dir__ we can restore order in the Universe." - by @fxn

Related to 5b8738c2df
2017-05-23 00:53:51 +03:00
dixpac 4f39556577 Improving docs for callbacks execution order [ci skip]
When define callbacks latest definition on the same callback/method
overwrites previous ones.
2017-05-21 18:45:59 +02:00
Ryuta Kamizono 89389428b5 Cleanup CHANGELOGs [ci skip]
* Remove trailing spaces.
* Add backticks around method and command.
* Fix indentation.
2017-04-30 02:41:44 +09:00
yuuji.yaginuma 8ae20e6582 Add missing require
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.
```
2017-04-21 08:02:26 +09:00
Steven Bull 452f9ee0bc Add error logging to Active Job
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.
2017-03-27 17:10:24 -07:00
Matthew Draper 6c08d480f1 Start Rails 5.2 development 2017-03-22 10:11:39 +10:30
David Heinemeier Hansson 85c2b7565f Revert #27850 following test breakage (#28427) 2017-03-15 17:46:28 +01:00
Rafael França cfa2664894 Merge pull request #28112 from bolek/include-job_id-in-all-active-job-logs
Include JobID in all ActiveJob info logs
2017-02-23 16:18:01 -05:00
Rafael Mendonça França f4acdd83ff
Preparing for 5.1.0.beta1 release 2017-02-23 14:53:21 -05:00
Bolek Kurowski 85c62a2c3d Include JobID in all ActiveJob info logs
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.
2017-02-22 17:11:28 -05:00
Jon Moss e342f4e60d Remove extra spaces
[ci skip]
2017-02-21 12:02:14 -05:00
yuuji.yaginuma 70e8fed5a3 remove `ActiveSupport.halt_callback_chains_on_return_false` from everywhere 2017-02-08 17:24:49 +09:00
Akira Matsuda c684f4f3da bin/test for Active Job and Action Cable tests
According to the commit comment on 54d84cbb77, AJ/bin/test was intentionally not added,
but AJ tests doesn't actually do anything special other than specifying ENV['AJ_ADAPTER'],
which can be easily done via command line environment variable.
2017-02-02 16:27:42 +09:00
Yuji Yaginuma 80dc309821 correctly set test adapter when configure the queue adapter on a per job (#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
2017-01-31 16:37:16 -05:00
Alexander Pauly 08ddca51c6 Append skipped jobs to enqueued_jobs
Refactored ActiveJob TestAdapter

Updated ActiveJob changelog

Fixed typo in changelog

Fixed formatting issue in changelog
2017-01-31 07:36:19 +01:00
yuuji.yaginuma acd4840c2a make backburner integration test to work
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.
81fde499c2

Therefore, this check process always becomes false, so the test is no
longer done. I fixed it so that check processing is done correctly.
2017-01-28 11:34:28 +09:00
Guillermo Iguaran 1a752b6f2b Merge pull request #27624 from elfassy/assert_enqueued_jobs_with_queue_level
Specify the queue to be used with assert_enqueued_jobs
2017-01-19 20:23:58 -05:00
Michael Elfassy 3738358135 assert_enqueued_jobs with queue option 2017-01-18 09:13:16 -05:00