Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

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

Closed
squarefrog opened this issue Oct 22, 2015 · 13 comments
Closed

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

squarefrog opened this issue Oct 22, 2015 · 13 comments
Labels

Comments

@squarefrog
Copy link
Contributor

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 😉

@squarefrog
Copy link
Contributor Author

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.

@squarefrog
Copy link
Contributor Author

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.

@bmalkowski
Copy link

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 fastlane/fastlane#338. My reinstall worked flawlessly without this workaround.

@squarefrog
Copy link
Contributor Author

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

@bmalkowski
Copy link

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. ;)

@KrauseFx
Copy link
Collaborator

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

@squarefrog
Copy link
Contributor Author

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.

@DigitalRogues
Copy link

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.

@koszcz
Copy link

koszcz commented Oct 27, 2015

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

@lam2558
Copy link

lam2558 commented Oct 29, 2015

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

@kcharwood
Copy link

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

@kcharwood
Copy link

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.

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#3369. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants