xsbt-coverall-plugin
SBT plugin that uploads scala code coverage to https://coveralls.io and integrates with Travis CI. This plugin uses scct to generate the code coverage metrics.
For an example project that uses this plugin click here
For example output click here
Installation
- Adding the following to your
project/build.sbt
file
resolvers += Classpaths.typesafeResolver
resolvers ++= Seq(
"scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo"
)
addSbtPlugin("reaktor" % "sbt-scct" % "0.2-SNAPSHOT")
addSbtPlugin("com.github.theon" %% "xsbt-coveralls-plugin" % "0.0.2")
- Add the following to your
build.sbt
seq(ScctPlugin.instrumentSettings : _*)
-
Register on
https://coveralls.io/
and get a repo token -
Follow the instructions for either Travis CI or Manual Usage
Travis CI Integration
xsbt-coverall-plugin
can be run by Travis CI by following these instructions:
-
Add the following to you
travis.yml
script: "sbt coveralls test"
-
Job done! Commit these changes to
travis.yml
to kick off your Travis build and you should see coverage reports appear on http://coveralls.io
Manual Usage
-
Either write your token into the file
~/.sbt/coveralls.repo.token
or into the environment variableCOVERALLS_REPO_TOKEN
export COVERALLS_REPO_TOKEN=
-
In the SBT console run the command
coveralls test
. This should run your test suite, generate code coverage reports and upload the reports tocoveralls.io
. After running the command, you should see output similar to the following:Uploading to coveralls.io succeeded: Job #17.1 https://coveralls.io/jobs/12207
For example output click here
SNAPSHOT Builds
Add the following to your project/build.sbt
file
resolvers += Classpaths.typesafeResolver
resolvers ++= Seq(
"scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo",
"sonatype-oss-repo" at "https://oss.sonatype.org/content/groups/public/"
)
addSbtPlugin("reaktor" % "sbt-scct" % "0.2-SNAPSHOT")
addSbtPlugin("com.github.theon" %% "xsbt-coveralls-plugin" % "0.0.3-SNAPSHOT")
TODO
For a list of features that going to be implemented see the issue tracker
License
xsbt-coveralls-plugin
is open source software released under the Apache 2 License.