Skip to content
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

Blank /tests/ember-tests.js in the test suite #799

Closed
jfturcot opened this issue May 8, 2012 · 15 comments
Closed

Blank /tests/ember-tests.js in the test suite #799

jfturcot opened this issue May 8, 2012 · 15 comments

Comments

@jfturcot
Copy link

jfturcot commented May 8, 2012

I have been trying to debug this since yesterday, but I really cannot find the solution and I guess others might run into the same problem so that's why I am asking for some help.

I am trying to run the test suite of the master branch on all the packages and this is what I am getting:

Died on test #1: JSHINTRC is not defined - {}

I realized later that I am getting this error because /tests/ember-tests.js asset returns a blank page, so the var JSHINTRC is never created, which is why I am getting that error when I run the full test suite.

I tried sandboxing the gems to make sure only the gems specified in the Gemfile are installed and I am still getting this error. Is there a gem missing in the Gemfile that's causing this error or is it some external package that's missing on my system (a nodejs package maybe)?

Thanks.

@wagenet
Copy link
Member

wagenet commented May 8, 2012

@jfturcot How are you trying to run the tests? Your options are to run rake test and watch the results in the command line, or to run rackup and then navigate to http://localhost:9292/tests/index.html?package=all

@jfturcot
Copy link
Author

jfturcot commented May 8, 2012

I tried both, the rake task and also with "bundle exec rackup".

Both give me the same error.

@wagenet
Copy link
Member

wagenet commented May 8, 2012

@jfturcot I run tests all the time without difficulty. Maybe try running rake clean first.

@jfturcot
Copy link
Author

jfturcot commented May 8, 2012

I did that and now I am getting the following error while running rake test

"\xC2" on US-ASCII

Those are the top few lines of the output when I trace it:

/Users/jfturcot/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rake-pipeline-543f4322fe70/lib/rake-pipeline/file_wrapper.rb:162:in `write'
/Users/jfturcot/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rake-pipeline-543f4322fe70/lib/rake-pipeline/file_wrapper.rb:162:in `write'
/Users/jfturcot/Code/Contrib/ember.js/Assetfile:48:in `block in generate_output'
/Users/jfturcot/Code/Contrib/ember.js/Assetfile:46:in `each'
/Users/jfturcot/Code/Contrib/ember.js/Assetfile:46:in `generate_output'
/Users/jfturcot/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rake-pipeline-543f4322fe70/lib/rake-pipeline/filter.rb:202:in `block (3 levels) in gene
rate_rake_tasks'
/Users/jfturcot/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rake-pipeline-543f4322fe70/lib/rake-pipeline/file_wrapper.rb:126:in `create'
/Users/jfturcot/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rake-pipeline-543f4322fe70/lib/rake-pipeline/filter.rb:202:in `block (2 levels) in gene
rate_rake_tasks'

I tried with 1.9.2 and 1.9.3 both with a clean set of gems on a Mac, it seems like a character encoding issue, could it be something Mac related?

@wagenet
Copy link
Member

wagenet commented May 8, 2012

This is my setup. I'm on a Mac as well:

% ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
% rvm -v
rvm 1.10.2 by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.beginrescueend.com/]

@jfturcot
Copy link
Author

jfturcot commented May 8, 2012

I am on 1.13 for rvm but I doubt this is what is causing the issue. I will try it on a clean Ubuntu install later today and then try to debug it again in Mac if it only fails in my system. If I manage to fix this issue, I will post on here how I did it just in case someone else run into this issue.

I had this problem while trying to test ember-data because I needed to submit a patch, so its not just with ember.js

@wagenet
Copy link
Member

wagenet commented May 8, 2012

Seems like this is the sort of thing @wycats is trying to solve with Tokaido.
By the way, what do you get for: ruby -e "puts Encoding.default_external" and ruby -e "puts Encoding.default_internal"?

@jfturcot
Copy link
Author

jfturcot commented May 8, 2012

ruby -e "puts Encoding.default_external"
US-ASCII
ruby -e "puts Encoding.default_internal"
"blank"

I get nothing for default_internal

You are right about Tokaido, I didn't see how I would need it before running into character encoding issues like this.

@wagenet
Copy link
Member

wagenet commented May 8, 2012

My default_external is UTF-8. I suspect that's the cause.

@jfturcot
Copy link
Author

jfturcot commented May 8, 2012

Yep! I ran the following in the shell to use UTF-8:

export RUBYOPT=-Ku

That changed the default encoding to UTF-8, I always thought that since 1.9 UTF-8 was always the default encoding, I guess I have some reading about encoding to do tonight.

Thanks a lot for your help!

@wagenet
Copy link
Member

wagenet commented May 8, 2012

I would have thought UTF-8 was default too. Maybe @wycats can chime in on this.

@reactormonk
Copy link

No, ruby default encoding is binary, unless specified otherwise by the env, like $LANG.

@jfturcot
Copy link
Author

jfturcot commented May 9, 2012

I just figured out why my shell was not using UTF-8. This week, I have been testing out the new SSH shell inside of Chrome, I wanted to see if I could replace my MacBook with a Chrome Book connecting to my local machine for developing while im on the road. Well that's what was changing my locale, if I use iTerm2 my shell uses UTF-8.

I don't have time to figure out how to make the Chrome SSH plugin use UTF-8, so I will just use iTerm2 for now. So if anyone has character encoding problems while using the Chrome SSH plugin, just use something else for now.

You can close this issue, thanks for your time.

@wagenet
Copy link
Member

wagenet commented May 9, 2012

@jfturcot Looks like you can set the LANG env variable to change the default.

@jfturcot
Copy link
Author

Yes that fixed it, I am now setting this in my zshrc file and it's now working fine. Thanks once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants