Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Add Resque 2 adapter #7

Closed
dhh opened this issue May 18, 2014 · 6 comments
Closed

Add Resque 2 adapter #7

dhh opened this issue May 18, 2014 · 6 comments

Comments

@dhh
Copy link
Member

dhh commented May 18, 2014

The API changed for Resque 2. Add adapter/wrapper to works with that as Resque2Adapter. Figure out a way to run tests with both Resque 1 and 2.

@seuros
Copy link
Member

seuros commented May 19, 2014

I will try to do this one too.

@cristianbica
Copy link
Member

@seuros any updates on this?
I was thinking about this and I saw 3 possible solutions:

  1. At the beginning of the test/helper.rb have a system "AJADAPTER=#{ENV['AJADAPTER']} bundle update resque" and in the Gemfile load resque gem depending on the AJADAPTER. (We will probably have to remove the Gemfile.lock from the repo also)
  2. Create a separate Gemfile.resque2. At the begining of test/helper.rbset BUNDLE_GEMFILE to Gemfile or Gemfile.resque2 based on AJADAPTER value
  3. Use appraisal

@seuros
Copy link
Member

seuros commented May 21, 2014

I added appraisal for now and changed the rake script, i can commit this change if you want.

The problem is that if you switch just the gem, the test will pass. That mean that the tests are not well writing, i'm going to make them fail first by using a real database instead of the fake ORM.

@cristianbica
Copy link
Member

Well the problem I saw with appraisal was that when running the whole test suite (aka rake test) they all should pass and I don't see that possible with appraisal. So ideally:

  • if I run rake test it should run all tests (the resque2 test should run with resque 2.x gem) and pass
  • if I run an individual test it should run that test (with the correct gem version for resque)

I would go with Gemfile.resque2...

@cristianbica
Copy link
Member

Here's what I had in mind: https://github.com/cristianbica/activejob/compare/resque2
Main issue with the implementation is that when updating developement gems you need to run bundle && BUNDLE_GEMFILE="Gemfile.resque1" bundle and BUNDLE_GEMFILE="Gemfile.resque2" bundle
Also the resque2 is in heavy development and stuff aren't working (Resque.inline, resque-scheduler). I suggest we wait for them to have a more stable version ready and then work on an adapter.

@dhh
Copy link
Member Author

dhh commented May 25, 2014

👍 to waiting until a stable version is out.

@dhh dhh closed this as completed May 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants