Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix CI task with asset pipeline #82

merged 1 commit into from Jun 21, 2012


None yet
2 participants

jasonm commented Mar 28, 2012

Update: So, I found this issue and addressed it, and then found that I was using an old rspec, 2.6.0, and this went away when I upgraded to >=2.7.0, so maybe you want to document a dependency of >=rspec-2.7.0 and/or reject this merge.

When I run the jasmine:ci task, the asset pipeline is not mounted, and my specs fail because /assets/application.js returns a 404. Ruby 1.9.3-p235, Rails 3.1.0, jasmine-gem on edge (34c1529).

Tracing this down, I found that Jasmine::Dependencies.rails_3_asset_pipeline? is returning true inside the jasmine_continuous_integration_runner rake task. Then, the RSpec rake task is invoked, which eventually calls Jasmine::Config#start_server and Jasmine.app inside /lib/jasmine/server.rb, at which point the .rails_3_asset_pipeline? method returns false.

Inside the .rails_3_asset_pipeline? method, the difference is that Rails.respond_to?(:application) is originally returning true, but later returns false. I suspected that Rails wasn't being loaded by the RSpec rake task correctly.

Changing the way Jasmine invokes the RSpec rake task from requiring config/environment.rb as a Ruby -r command line argument to an RSpec -r command line argument fixes this.

Details: https://gist.github.com/92c7e7ced6f3b1935712


ragaskar commented Mar 28, 2012

If this fixes it, we'll probably want to pull it, since there's often all sorts of people using

That said, we've typically taken an integration approach to these sorts of things (ie, re-running the suite using the targeted gem versions), and that scales poorly. We'll need to push around the tests a bit to accomodate this and that might take awhile.


jasonm commented Mar 29, 2012

@ragaskar Thanks. I don't think the affected lines actually have test coverage (originally introduced in 3d1a1e0) so the pull wouldn't affect the suite right now. Happy to contribute a test, what do you mean by "We'll need to push around the tests a bit to accomodate this?"

On the general point of testing against different dependency versions, I've found https://github.com/thoughtbot/appraisal to work nicely, although I see you have a system going with conditionals in the gemspec.


ragaskar commented Apr 30, 2012

Sorry, picking up this thread again after some time has passed -- do you happen to know if the interface is the same between 2.6.0 and 2.7.0? If so, we'll just merge it. I haven't seen any reds related to this, but we don't have any asset pipeline specific integration tests ....


jasonm commented May 1, 2012

@ragaskar Hmmm, I'm pretty sure it is. With this patch, the task ran correctly against both rspec 2.6.0 and 2.7.0. Briefly consulting the docs, it looks like 2.8.0 and 2.9.0 follow suit.


ragaskar commented Jun 21, 2012

We've got some other reports of this problem, so I'm going to go ahead and merge this. It sounds like the only currently untested case is 2.5.0. Still curious why this is a problem. Sorry for the dragging of feet, and thanks for the pull request!

@ragaskar ragaskar added a commit that referenced this pull request Jun 21, 2012

@ragaskar ragaskar Merge pull request #82 from jasonm/master
Fix CI task with asset pipeline

@ragaskar ragaskar merged commit ddeb565 into jasmine:master Jun 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment