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

Couldn't parse the number of tests from the output #3369

Closed
fastlanebot opened this issue Oct 22, 2015 · 12 comments
Closed

Couldn't parse the number of tests from the output #3369

fastlanebot opened this issue Oct 22, 2015 · 12 comments

Comments

@fastlanebot
Copy link

Original issue by @squarefrog - Imported from fastlane/scan#6

I get the following after running scan.

[14:29:41]: Couldn't parse the number of tests from the output
/Users/pi/.gem/gems/scan-0.1.0/lib/scan/runner.rb:52:in `handle_results': undefined method `>' for nil:NilClass (NoMethodError)
        from /Users/pi/.gem/gems/scan-0.1.0/lib/scan/runner.rb:10:in `run'
        from /Users/pi/.gem/gems/scan-0.1.0/lib/scan/manager.rb:10:in `work'
        from /Users/pi/.gem/gems/scan-0.1.0/lib/scan/commands_generator.rb:41:in `block (2 levels) in run'
        from /Users/pi/.gem/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
        from /Users/pi/.gem/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
        from /Users/pi/.gem/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
        from /Users/pi/.gem/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
        from /Users/pi/.gem/gems/commander-4.3.5/lib/commander/runner.rb:68:in `run!'
        from /Users/pi/.gem/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
        from /Users/pi/.gem/gems/scan-0.1.0/lib/scan/commands_generator.rb:60:in `run'
        from /Users/pi/.gem/gems/scan-0.1.0/lib/scan/commands_generator.rb:14:in `start'
        from /Users/pi/.gem/gems/scan-0.1.0/bin/scan:6:in `<top (required)>'
        from /Users/pi/.gem/bin/scan:23:in `load'
        from /Users/pi/.gem/bin/scan:23:in `<main>'

I'm not really sure what additional information will be useful to you here, but shoot me a message if there's something in particular. I have the full log (795KB - 338 tests) if you need it but it contains some pre-release info in there so I'd rather it wasn't public 😉

@fastlanebot
Copy link
Author

@squarefrog commented

Oh I see where the error occurs.

if result[:failures] > 0
  failures_str = result[:failures].to_s.red
else
  failures_str = result[:failures].to_s.green
end

My tests pass so result[:failures] is nil 😏 I'll have a look at a pull request for you tomorrow.

@fastlanebot
Copy link
Author

@squarefrog commented

I've tried to replicate this across 3 machines. Only 1 exhibits the behaviour.

Ruby 2.0.0p481 (default Ruby in Yosemite) ✔️
Ruby 2.2.1p85 (default Ruby in El Cap) ✔️
Ruby 2.2.3p173 (i have no idea where I installed this from /usr/local/bin/ruby) ✖️
Ruby 2.2.3p173 (installed with rbenv) ✔️

Closing this as I think its definitely an issue with my machine rather than scan.

@fastlanebot
Copy link
Author

@bmalkowski commented

In case someone else runs across this, I ran into this same error message trying to get scan to run. I was able to fix it by upgrading to Ruby 2.2.1p85 from Ruby 2.0.0. I then reinstalled scan and fastlane.

It may be a red herring, but my initial install of the tools did run into issues that I worked around based on #338. My reinstall worked flawlessly without this workaround.

@fastlanebot
Copy link
Author

@squarefrog commented

Interesting that you got it on Ruby 2.0.0 was this system ruby or rbenv/chruby/rvm?

@fastlanebot
Copy link
Author

@bmalkowski commented

I'd say probably system Ruby that came installed with Yosemite. I used rvm to get Ruby 2.2.1. And that's about the extent of my ruby knowledge. ;)

@fastlanebot
Copy link
Author

@KrauseFx commented

Interesting... @squarefrog did you find the source of this issue?

@fastlanebot
Copy link
Author

@squarefrog commented

I thought I had, but it turned out it was just an odd install.

I'm scratching my head about this. It's only that install that I had difficulty with. I use a shared GEM_HOME so it's not even like there was something wrong with the gem.

Diffing the broken run log against a working one doesn't appear to show anything untoward.

I don't know if you can shed any more light on the flow after the build? It looked like it was just tee'd into xcpretty then the output scraped with scan.

I can't immediately see any points of failure. Shoot me a DM on Twitter if you want me to send the logs.

@fastlanebot
Copy link
Author

@DigitalRogues commented

I'm running into this problem also but only via running fastlane, running scan directly seems to work fine. I have ruby version ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15] via homebrew

Looks like I'm seeing the error running scan directly via jenkins also on a different server with the same version of ruby.

@fastlanebot
Copy link
Author

@koszcz commented

I have the same issue on ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14] installed via RVM

@fastlanebot
Copy link
Author

@lam2558 commented

I fixed this by updating ruby and ruby gem:
rbenv install 2.2.2
rbenv global 2.2.2
gem update --system

@fastlanebot
Copy link
Author

@kcharwood commented

I'm seeing this error at the start of running scan:

Loading...
tee: /Users/kevin.harwood/Library/Logs/scan/MyKit-MyKit.log: Permission denied

Followed by this at the end:

cat: /Users/kevin.harwood/Library/Logs/scan/MyKit-MyKit.log: No such file or directory
[08:11:47]: Couldn't parse the number of tests from the output

@fastlanebot
Copy link
Author

@kcharwood commented

It looks like /Users/kevin.harwood/Library/Logs/scan may have been created a while ago when I ran scan against another project, most likely with scan install via a different mechanism. Removing that directory, and letting scan recreate it seems to have worked for me.

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

No branches or pull requests

1 participant