3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

BitriseのXcode Test for iOSでxcpretty-json-formatterを使いたい

Last updated at Posted at 2019-11-21

前段

  1. PRをDangerでチェックしよう
  2. DangerはBitriseで実行
  3. danger-xcode_summaryも使うよ
  4. xcpretty-json-formatterを使うようだ
  5. Xcode Test for iOSのオプションに設定
Additional options for \`xcpretty\` test call 6. エラー:poop:
Running the tests...
$ set -o pipefail && env "NSUnbufferedIO=YES" xcodebuild "-workspace" "/Users/vagrant/git/hoge.xcworkspace" "-scheme" "hoge" "build" "COMPILER_INDEX_STORE_ENABLE=NO" "test" "-destination" "id=A7F5E87E-37C3-47DC-B911-FE80D8CBFED7" "-resultBundlePath" "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/XCUITestOutput773104676/Test.xcresult" "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES" "GCC_GENERATE_TEST_COVERAGE_FILES=YES" | xcpretty "-f" "`xcpretty-json-formatter`" "--color" "--report" "html" "--output" "/Users/vagrant/deploy/xcode-test-results-hoge.html"
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty.rb:19:in `read': No such file or directory @ rb_sysopen - `xcpretty-json-formatter` (Errno::ENOENT)
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty.rb:19:in `class_from_path'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty.rb:27:in `load_custom_class'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-0.3.0/bin/xcpretty:42:in `block (2 levels) in <top (required)>'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/optparse.rb:1614:in `block in parse_in_order'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/optparse.rb:1568:in `catch'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/optparse.rb:1568:in `parse_in_order'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/optparse.rb:1562:in `order!'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/optparse.rb:1656:in `permute!'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/optparse.rb:1678:in `parse!'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-0.3.0/bin/xcpretty:73:in `block in <top (required)>'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/optparse.rb:1089:in `initialize'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-0.3.0/bin/xcpretty:27:in `new'
	from /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-0.3.0/bin/xcpretty:27:in `<top (required)>'
	from /Users/vagrant/.rbenv/versions/2.6.3/bin/xcpretty:23:in `load'
	from /Users/vagrant/.rbenv/versions/2.6.3/bin/xcpretty:23:in `<main>'

現象

No such file or directory

  • 原因

"-f" "`xcpretty-json-formatter`"

  • 理由

Adding parameters to xcpretty don't work has expected #119

mackoj > I did find a way to fix it but the auto double quoting is still very annoying...

:thinking:

解決

  1. Scriptを追加
    envman add --key XCPRETTY_JSON_FORMATTER --value `xcpretty-json-formatter`
    Script

  2. Additional options for `xcpretty` test callに設定
    -f ${XCPRETTY_JSON_FORMATTER}

Additional options for \`xcpretty\` test call

参考

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?