Bitrise의 Xcode Test for iOS에서 xcpretty-json-formatter 사용

이전 단락

  • PRDanger
  • 검토
  • Bitrise에서 Danger
  • 실행
  • danger-xcode_summary도 사용하세요
  • xcpretty-json-formatter
  • Xcode Test for iOS로 설정 옵션

  • 오류
  • 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...

    해결하다

  • Script 추가envman add --key XCPRETTY_JSON_FORMATTER --value `xcpretty-json-formatter`
  • xcprettytest call for Additional options로 설정-f ${XCPRETTY_JSON_FORMATTER}
  • 참고 자료

  • 위탁 개발된 iOS 응용 프로그램의 새 실천 (다음: Bitrise 편)
  • danger-xcode_summary
  • xcpretty-json-formatter
  • 좋은 웹페이지 즐겨찾기