Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Can't read Xcode log file #8

Open
ilyapuchka opened this issue Jun 17, 2018 · 5 comments
Open

Can't read Xcode log file #8

ilyapuchka opened this issue Jun 17, 2018 · 5 comments

Comments

@ilyapuchka
Copy link

When I'm trying to read log file generated by fastlane I see the following error

cat ~/Library/Logs/scan/babylon-Babylon.log | xcpretty -f "xcpretty-json-formatter"
/usr/local/bin/ruby/2.4.0/gems/xcpretty-0.2.8/lib/xcpretty.rb:19:in `read': No such file or directory @ rb_sysopen - xcpretty-json-formatter (Errno::ENOENT)
	from /usr/local/bin/ruby/2.4.0/gems/xcpretty-0.2.8/lib/xcpretty.rb:19:in `class_from_path'
	from /usr/local/bin/ruby/2.4.0/gems/xcpretty-0.2.8/lib/xcpretty.rb:27:in `load_custom_class'
	from /usr/local/bin/ruby/2.4.0/gems/xcpretty-0.2.8/bin/xcpretty:42:in `block (2 levels) in <top (required)>'
	from /Users/ilya.puchka/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:1584:in `block in parse_in_order'
	from /Users/ilya.puchka/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:1538:in `catch'
	from /Users/ilya.puchka/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:1538:in `parse_in_order'
	from /Users/ilya.puchka/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:1532:in `order!'
	from /Users/ilya.puchka/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:1626:in `permute!'
	from /Users/ilya.puchka/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:1648:in `parse!'
	from /usr/local/bin/ruby/2.4.0/gems/xcpretty-0.2.8/bin/xcpretty:73:in `block in <top (required)>'
	from /Users/ilya.puchka/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:1062:in `initialize'
	from /usr/local/bin/ruby/2.4.0/gems/xcpretty-0.2.8/bin/xcpretty:27:in `new'
	from /usr/local/bin/ruby/2.4.0/gems/xcpretty-0.2.8/bin/xcpretty:27:in `<top (required)>'
	from /Users/ilya.puchka/.rvm/gems/ruby-2.4.1/bin/xcpretty:23:in `load'
	from /Users/ilya.puchka/.rvm/gems/ruby-2.4.1/bin/xcpretty:23:in `<main>'
	from /Users/ilya.puchka/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
	from /Users/ilya.puchka/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'

The command that fastlane scan executes is following:

set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace ./Babylon.xcworkspace -scheme Babylon -configuration Debug -destination 'platform=iOS Simulator,id=BB4396A6-7293-4863-88DC-15A38A801E1E' -derivedDataPath '/Users/ilya.puchka/Library/Developer/Xcode/DerivedData/Babylon-cganrmibthibvkepvoondhopatcw' build test | tee '/Users/ilya.puchka/Library/Logs/scan/babylon-Babylon.log' | xcpretty -f `xcpretty-json-formatter` --report html --output '/Users/ilya.puchka/dev/babylon-ios/fastlane/test_output/report.html' --report junit --output '/Users/ilya.puchka/dev/babylon-ios/fastlane/test_output/report.junit' --report junit --output '/var/folders/28/cn8n570x0bs_hzvsyl0yd4d891kn2m/T/junit_report20180617-44360-1okexpn'

After this is run I do get json report file, but it does not contain expected test failures, only warnings and test summary messages.

@marcelofabri
Copy link
Owner

You need to use backticks when running xcpretty:

cat ~/Library/Logs/scan/babylon-Babylon.log | xcpretty -f `xcpretty-json-formatter`

Are the test failures showing up on the html or junit reports?

@ilyapuchka
Copy link
Author

I got -bash: xcpretty-json-formatter: command not found error when I'm trying to do that, but that was because I had installed xcpretty-json-formatter via bundler, installing it system wide solved it.
Yes, test failures are in report.html, but they don't appear in json.

@marcelofabri
Copy link
Owner

It's hard to investigate without the log or a repro example. It'd be really helpful if you could upload it or send to me privately so I can take a closer look.

@qyhongfan
Copy link

bash: xcpretty-json-formatter: command not found
/Users/hurry.qin/Work/AGWorkflow/ruby-bundles/ruby/2.3.0/gems/xcpretty-0.3.0/lib/xcpretty.rb:19:in read': No such file or directory @ rb_sysopen - -o (Errno::ENOENT) from /Users/hurry.qin/Work/AGWorkflow/ruby-bundles/ruby/2.3.0/gems/xcpretty-0.3.0/lib/xcpretty.rb:19:in class_from_path'
from /Users/hurry.qin/Work/AGWorkflow/ruby-bundles/ruby/2.3.0/gems/xcpretty-0.3.0/lib/xcpretty.rb:27:in load_custom_class' from /Users/hurry.qin/Work/AGWorkflow/ruby-bundles/ruby/2.3.0/gems/xcpretty-0.3.0/bin/xcpretty:42:in block (2 levels) in <top (required)>'
from /Users/hurry.qin/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1578:in block in parse_in_order' from /Users/hurry.qin/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1534:in catch'
from /Users/hurry.qin/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1534:in parse_in_order' from /Users/hurry.qin/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1528:in order!'
from /Users/hurry.qin/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1620:in permute!' from /Users/hurry.qin/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1642:in parse!'
from /Users/hurry.qin/Work/AGWorkflow/ruby-bundles/ruby/2.3.0/gems/xcpretty-0.3.0/bin/xcpretty:73:in block in <top (required)>' from /Users/hurry.qin/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1062:in initialize'
from /Users/hurry.qin/Work/AGWorkflow/ruby-bundles/ruby/2.3.0/gems/xcpretty-0.3.0/bin/xcpretty:27:in new' from /Users/hurry.qin/Work/AGWorkflow/ruby-bundles/ruby/2.3.0/gems/xcpretty-0.3.0/bin/xcpretty:27:in <top (required)>'
from /usr/local/bin/xcpretty:23:in load' from /usr/local/bin/xcpretty:23:in

'
from /Users/hurry.qin/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in eval' from /Users/hurry.qin/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in '

same problem

@qyhongfan
Copy link

I solved this error by reinstall xcpretty-json-formatter

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

No branches or pull requests

3 participants