Commit Graph

378 Commits

Author SHA1 Message Date
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
utilum
893069fa02 Output adapter being tested. 2016-12-12 21:52:04 +01:00
Matthew Draper
0e97cd1a0d Avoid race condition in AJ integration tests
Make sure the file doesn't exist until we've finished writing it.
2016-11-30 21:10:52 +10:30
yuuji.yaginuma
5b825c55fe remove Ruby warning from Active Job test helper methods
This removes the following warnings.

```
/home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:241: warning: shadowing outer local variable - job
/home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:265: warning: shadowing outer local variable - job
```
2016-11-18 18:20:48 +09:00
Maxime Boisvert
c061236cc7 Use named parameters instead of assert_valid_keys 2016-11-16 17:19:48 -05:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
Xavier Noria
7506f33906 removes requires already present in active_support/rails 2016-10-27 09:45:20 +02:00
Gabi Stefanini
393f25bdba Uses queue adapter_method instead of ActiveJob::Base.queue_adapter
Change ActiveJob::Base.queue_adapter to use queue_adapter method to make test code consistent.
2016-10-24 22:25:48 -04:00
Gabi Stefanini
0d454d0806 Add examples of queue_adapter and perform_enqueued jobs to API Docs. 2016-10-21 11:59:01 -04:00
yuuji.yaginuma
77bdbb5f41 add missing closing tag [ci skip] 2016-10-14 09:15:51 +09:00
Rafael Mendonça França
d1fc0a5eb2
Removed deprecated support to passing the adapter class to .queue_adapter 2016-10-10 15:00:28 -03:00
Rafael Mendonça França
d861a1fcf8
Removed deprecated #original_exception in ActiveJob::DeserializationError 2016-10-10 14:55:20 -03:00
Jon Moss
743dba533e Merge pull request #26740 from y-yagi/update_retry_on_example
correct exception class in `retry_on` example [ci skip]
2016-10-08 19:51:42 -04:00
yuuji.yaginuma
be199dfae2 correct exception class in retry_on example [ci skip]
If the deadlock has occurred `ActiveRecord::Deadlocked` will raise.
Ref: #25107, #26059
2016-10-09 08:46:31 +09:00
Matthew Draper
cb0452e9a5 Fixnum and Bignum are deprecated in Ruby trunk
https://bugs.ruby-lang.org/issues/12739
2016-10-08 08:13:11 +10:30
yuuji.yaginuma
6a8e7fd8d8 fix link to resque [ci skip]
`1-x-stable` branch does not exist, `master` is 1.x branch.
Ref: http://words.steveklabnik.com/rescuing-resque-again
2016-09-20 08:56:05 +09:00
yuuji.yaginuma
0b2197774c use descendants to get class that inherited ActiveJob::Base
`subclasses` get only child classes.
Therefore, if create a job common parent class as `ApplicationJob`,
inherited class does not get properly.
2016-09-05 09:21:10 +09:00
Xavier Noria
bb1ecdcc67 fixes remaining RuboCop issues [Vipul A M, Xavier Noria] 2016-09-01 23:41:49 +02:00
Rafael Mendonça França
0510208dd1
Add load hooks to all tests classes
Usually users extends tests classes doing something like:

    ActionView::TestCase.include MyCustomTestHelpers

This is bad because it will load the ActionView::TestCase right aways
and this will load ActionController::Base making its on_load hooks to
execute early than it should.

One way to fix this is using the on_load hooks of the components like:

    ActiveSupport.on_load(:action_view) do
      ActionView::TestCase.include MyCustomTestHelpers
    end

The problem with this approach is that the test extension will be only
load when ActionView::Base is loaded and this may happen too late in the
test.

To fix this we are adding hooks to people extend the test classes that
will be loaded exactly when the test classes are needed.
2016-08-25 04:22:48 -03:00
Rafael Mendonça França
7f4b16ed83
Merge pull request #26205 from pedaling-corp/fix/active-job-resque
Add @queue variable to JobWrapper
2016-08-23 00:39:39 -03:00
yuuji.yaginuma
88f9a1540a correct exception class in retry_on example [ci skip]
If the deadlock has occurred `ActiveRecord::Deadlocked` will raise.
Ref: #25107, #26059
2016-08-20 17:21:14 +09:00
InJung Chung
9f6461a28c Added instance variable @queue to JobWrapper.
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.
2016-08-19 17:10:27 +09:00
David Heinemeier Hansson
a1e4c197cb Yield the job instance so you have access to things like job.arguments on the custom logic after retries fail 2016-08-16 16:01:59 -07:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Vipul A M
8b984161d6
Pass over changelogs [ci skip] 2016-08-10 09:33:13 +05:30
Xavier Noria
a9dc45459a code gardening: removes redundant selfs
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.
2016-08-08 01:12:38 +02:00
Ryuta Kamizono
762e3f05f3 Add Style/EmptyLines in .rubocop.yml and remove extra empty lines 2016-08-07 17:50:59 +09:00
Xavier Noria
b326e82dc0 applies remaining conventions across the project 2016-08-06 20:20:22 +02:00
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
411ccbdab2 remove redundant curlies from hash arguments 2016-08-06 19:44:11 +02:00
Xavier Noria
301ce2a6d1 modernizes hash syntax in activejob 2016-08-06 19:36:54 +02:00
Xavier Noria
e6ab70c439 applies new string literal convention to the rest of the project
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:28:46 +02:00
Xavier Noria
adca8154c6 applies new string literal convention in the gemspecs
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:27:12 +02:00
Xavier Noria
bde6547bb6 applies new string literal convention in activejob/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:41:18 +02:00