-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with ResqueSpec.reset! while using spork #69
Comments
If you see errors about failed connections to Redis, it is most likely that you are using a plugin. Resque plugins are usually (pre 2.0) written fairly loosely and often just reach directly into Redis to manipulate data, some their own, and some Resque's. This is neither good nor bad, just reality. If you are using a plugin and can see an easy way to mock it, please open a PR and I will add it to resque_spec. Ideally in 2.0, every plugin provides some implementation for tests and some simple assertions. For example the /cc @steveklabnik |
Yup. Though if you're getting an ECONNREFUSED it seems more serious. Are you sure you have a Redis running? |
I wanted to be able to run the tests without having to have a Redis instance running. |
It's not going to be fully possible, because Resque forks, you need a connection to an actual sever. 12 of our tests require a real one, even if the rest don't. |
Interesting. Glad I asked before I spent a week going down a hole that doesn't have an end Thanks for the feedback. Gem works with Redis server running. |
Yeah, I'm super bummed about it, and it's something that I'm working on. |
I hacked it a bit. It needs some tests but this would work. All my test pass without a redis-server running. Also, it injects the requests to the specified queues. |
Sorry it took so long to take a look at this, but did you follow the instructions in the README for A cursory look and your commit seems to be doing the same thing |
I am using spork and including ResqueSpec.reset! in Spork.each_run block
However in the rspec tests, i am still getting failures due to the system not being able to connect to the Redis server. I have also attempted to use it by sticking it in before(:each)
Failure/Error: @order = FactoryGirl.create(:order)
Redis::CannotConnectError:
Error connecting to Redis on localhost:6379 (ECONNREFUSED)
Suggestions?
The text was updated successfully, but these errors were encountered: