Commit Graph

411 Commits

Author SHA1 Message Date
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 5b8738c2df003a96f0e490c43559747618d10f5f
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 54d84cbb77a7fbc6359eda4eb40cc7da29c426e1, 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
Akira Matsuda
050018d48e s/perfomed/performed/
[ci skip]
2017-01-17 04:05:52 +09:00
yuuji.yaginuma
c2b5c057fa remove unused require
`InlineAdapter` is not used from 1f8558f.
2017-01-15 13:02:03 +09:00
Akira Matsuda
5473e390d3 self. is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
2017-01-05 19:58:52 +09:00
Rafael Mendonça França
b6ffb5efcb
Revert "Merge pull request #27550 from mtsmfm/fix-generator-command-for-nested-rails-engine"
This reverts commit 1e969bfb98b88799e2c759fce25a1d8cf00d7ce7, reversing
changes made to a5041f267ded119c2d00b8786c2f2c1e3f93c8a1.

Reason: It breaks the public API
2017-01-03 21:51:18 -05:00
Fumiaki MATSUSHIMA
085546df45 Fix generator command for nested (namespaced) rails engine
If we create nested (namespaced) rails engine such like bukkits-admin,
`bin/rails g scaffold User name:string age:integer`
will create
`bukkits-admin/app/controllers/bukkits/users_controller.rb`
but it should create
`bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`.

In #6643, we changed `namespaced_path` as root path
because we supposed application_controller is always in root
but nested rails engine's application_controller will not.
2017-01-03 21:18:09 +09:00
Rafael França
b92c0fa863 Merge pull request #27508 from zzz6519003/patch-1
remove useless import
2017-01-01 22:58:50 -05:00
Jon Moss
37d956f45f Bump license years for 2017
Per https://www.timeanddate.com/counters/firstnewyear.html, it's already
2017 in a lot of places, so we should bump the Rails license years to
2017.

[ci skip]
2016-12-31 08:34:08 -05:00
Snowmanzzz(Zhengzhong Zhao)
7eef8d35d7 remove useless import 2016-12-30 19:40:26 +08:00
Rafael Mendonça França
030dff74ce
Delayed job doesn't support Active Record 5.1 yet 2016-12-29 17:53:04 -05:00
Akira Matsuda
e8ba0c0f21 "Use assert_nil if expecting nil. This will fail in minitest 6." 2016-12-25 02:29:52 +09:00
Akira Matsuda
102ee40557 Privatize unneededly protected method in Active Job 2016-12-24 21:16:13 +09:00
Akira Matsuda
726b71cbb2 No need to nodoc private methods 2016-12-24 21:16:13 +09:00
Akira Matsuda
7269d9de6a Privatize unneededly protected methods in Active Job tests 2016-12-24 00:15:18 +09:00
Kir Shatrov
2f421fa294 Remove warning in ActiveJob
Currently it causes:

```
activejob/Rakefile:5: warning: already initialized constant ACTIVEJOB_ADAPTERS
```
2016-12-21 20:38:12 -05:00