Coveralls plugin for fastlane

 日本語

Main

I’ve just published a fastlane plugin that sends Xcode code coverage to Coveralls and its depending library xccoveralls that also works as standalone command line tool.

Quick Start

Run the following command

fastlane add_plugin coveralls

Add the following line to your Fastfile

lane :send_coveralls do
  coveralls
end

Make sure Code Coverage checkbox is turned on for your test target.

Checkbox

Then you can send coverage data from fastlane command

export XCCOVERALLS_REPO_TOKEN=... # grab yours from Coveralls.io
bundle exec fastlane send_coveralls

You can check CI2Go coverage on Coveralls and Fastfile.

Motivation

I tried to introduce Xcov which is built into fastlane action, but it does not send covered lines because it uses .xccovreport or .xccoverage file which contains only summary of test coverage.

So I started implementing with xcrun xccov which was introduced in Xcode 9.3.

# List files
$ xcrun xccov view --file-list DerivedData/Logs/Build/*.xccovarchive
# Code coverage for specific file
$ xcrun xccov view --file /Users/ngs/src/CI2Go/AppDelegate.swift \
    DerivedData/Logs/Build/*.xccovarchive

ref: xccov: Xcode Code Coverage Report for Humans

Please send me issues if you have any.

Enjoy XCTesting computer

comments powered by Disqus