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

Getting "no such file or directory" - transpec_analysis_result.json #45

Closed
myronmarston opened this issue Feb 23, 2014 · 6 comments
Closed

Comments

@myronmarston
Copy link

Running transpec against rspec-mocks spec suite, I get this:

/Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:119:in `initialize': No such file or directory - transpec_analysis_result.json (Errno::ENOENT)
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:119:in `open'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:119:in `block in analyze'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:126:in `in_copied_project'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:104:in `analyze'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/cli.rb:53:in `block in process'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:90:in `block in initialize'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:134:in `block (2 levels) in in_copied_project'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:133:in `chdir'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:133:in `block in in_copied_project'
    from /Users/myron/.rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:130:in `in_copied_project'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/dynamic_analyzer.rb:89:in `initialize'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/cli.rb:51:in `new'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/cli.rb:51:in `process'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/cli.rb:37:in `run'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/lib/transpec/cli.rb:19:in `run'
    from /Users/myron/.gem/ruby/1.9.3/gems/transpec-1.9.2/bin/transpec:7:in `<top (required)>'
    from /Users/myron/.gem/ruby/1.9.3/bin/transpec:23:in `load'
    from /Users/myron/.gem/ruby/1.9.3/bin/transpec:23:in `<main>'
@yujinakayama
Copy link
Owner

I guess your rspec-mocks directory is in rspec-dev/repos. In that case, the Gemfile of rspec-mocks refers ../rspec-core and ../rspec-expectations. However, as described in the README, Transpec needs to run the specs in a temporarily copied project directory, but the parent directory won't be copied. So I think you need to run transpec --rspec-command 'bundle install && bundle exec rspec'

@yujinakayama
Copy link
Owner

I've confirmed transpec --rspec-command 'bundle install && bundle exec rspec' is working, and fixed some issues in Transpec with rspec-mocks project (including #46). Please try out version 1.9.3.

@yujinakayama
Copy link
Owner

@myronmarston Can I close this issue?

@myronmarston
Copy link
Author

Yep!

@myronmarston
Copy link
Author

Hmm, actually, one suggestion: it seems like transpec can determine if a project will have this issue by looking at Gemfile.lock and/or Gemfile and seeing it has some :path gems that are outside the working directory, and that therefore will have this issue. Rather than failing with this confusing error, could it give a better error message instructing the user to use a different --rspec-command option?

@yujinakayama
Copy link
Owner

I think there would be various problems with project-specific setup, and handling only this case does not help much. However I agree the error No such file or directory - transpec_analysis_result.json (Errno::ENOENT) does not give enough information for troubleshooting and it should be improved.

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

2 participants