-
Notifications
You must be signed in to change notification settings - Fork 243
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
Better "failed to load" information #120
Comments
Yes, there's code in there for that that used to work in rails 3.2.x, so I assume it must've broken with 4? This was important for that to work: https://github.com/modeset/teaspoon/blob/master/lib/teaspoon/console.rb#L13 Jeremy Jackson
|
Ah ok, I use Rails 4. I'll see if I can fix this. Thanks for the prompt answer! |
Basically if an exception is thrown before the tests starts, teaspoon will display that and exit. So if you can figure out how to get sprockets-rails to generate the exception (outside of teaspoon) instead of a serving a 404 it will work how you'd expect. Same goes for coffeescript that can't compile. Jeremy Jackson
|
Also rails 4 complains with an error page if the db migrations were not applied, that causes |
@ALL, please check this by pointing your gem at master -- it at least handles migration exceptions, and I assume all others that happen before making it to the specs controller. If possible, and for bonus point (nothing else really), it would be great to check this in rails 3 as well -- to make sure nothing blows up. If everything works well I'll release it. |
More or less same error message as before, but w/o the $ bundle exec teaspoon
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:62202/teaspoon/default
Error: Failed to load: http://127.0.0.1:62202/teaspoon/default?reporter=Console |
Try requiring teaspoon/exception_handling at the bottom of your initializer. This shouldn't make a difference, but I would like to know. Jeremy Jackson
|
That seemed to do the trick: $ bundle exec teaspoon
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:51554/teaspoon/default
Error: Sprockets::FileNotFound: couldn't find file 'broken_file.js'
(in /Users/viddo/src/project/app/assets/javascripts/application.js:1)
# http://127.0.0.1:51554/teaspoon/default?reporter=Console:1
Error: Failed to load: http://127.0.0.1:51554/teaspoon/default?reporter=Console |
Hmmm. I don't want you to have to include that file manually. Could you privately email me your application.rb and development.rb files? Assuming you're running teaspoon in the Dev env. Jeremy Jackson
|
Running in dev env yes. I managed to narrow down the cause to be related to the better_errors gem and having setting You should be able to reproduce it by setting up a fresh Rails 4 project and apply this patch: https://gist.github.com/viddo/7104245 (the rest of application.rb and development.rb are the default settings). |
That would make sense.. the better_errors gem is hooking into the same area teaspoon tries to hook into. I'm hooking into the rails middleware that displays the errors, and if something else is changing that out from under teaspoon then there's not really much to do about it. In your specific case with better_errors, you're going to have to manually require the file, but people not using better_errors should be fine without it. Thanks much for helping me clarify why it wasn't working for you out of the box.. It may be worth a mention in the wiki or something. |
We're getting the same error, just removed Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:51237/teaspoon/default
cache: [GET /teaspoon/default?reporter=Console] miss
Failed to load: http://127.0.0.1:51237/teaspoon/default?reporter=Console We're in the process of upgrading to rails 4, and we couldn't get the Konacha runner working on our CI machine so we're attempting a switch over to Teaspoon. Specs pass through the browser, but the runner just doesn't load up a server. Can you suggest anything that would give us a bit more output about why it's failing? |
nm sorry, we've got some custom middleware that was blocking the runner. It might be useful to document that the test runner is still mounted inside your normal rails app, so any custom middleware might affect the request to |
I noticed that if one of my spec files (or spec_helper) contains a faulty require, e.g.:
Then
teaspoon
yields:Is it be possible for teaspoon to give something more useful to identify this kind of error rather than just saying "Failed to load"? I would not mind to help out to implement this but wanted to see if this is a known issue, and if there are some efforts to solve this before.
The text was updated successfully, but these errors were encountered: