Skip to content

Commit

Permalink
Merge pull request #32 from travisbrown/set-up-scoverage
Browse files Browse the repository at this point in the history
Turn on and configure test coverage reporting
  • Loading branch information
travisbrown committed Jan 31, 2015
2 parents 421ab3f + c682218 commit cef1708
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 22 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
sudo: false

language: scala

scala:
Expand All @@ -11,4 +9,8 @@ jdk:
- oraclejdk7
- oraclejdk8

script: "sbt ++$TRAVIS_SCALA_VERSION test it:test"
script:
- sbt ++$TRAVIS_SCALA_VERSION coverage test it:test

after_success:
- sbt coveralls
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/finagle/finagle-serial.svg?branch=master)](https://travis-ci.org/finagle/finagle-serial)
# Finagle Serial

[![Build status](https://img.shields.io/travis/finagle/finagle-serial/master.svg)](http://travis-ci.org/finagle/finagle-serial) [![Coverage status](https://img.shields.io/coveralls/finagle/finagle-serial/master.svg)](https://coveralls.io/r/finagle/finagle-serial?branch=master)

Finagle Serial supports the creation of [Finagle][1] servers and clients that
use Scala (or Java) libraries for serialization instead of IDL-based systems
Expand All @@ -18,8 +20,7 @@ your choice. We currently provide support for [Scodec][6].
* [Benchmarks](#benchmarks)
* [License](#license)

Quickstart
----------
## Quickstart

Let's start with some simple case classes:

Expand Down Expand Up @@ -73,8 +74,7 @@ client(User("Mary")).onSuccess { greeting =>
That's all! No plugins, no IDLs, no code generation, and very little
boilerplate.

Installation
------------
## Installation

Serial is brand new and is not published to Maven Central at the moment (it will
be soon), but for now you can check out this repository, run
Expand All @@ -84,8 +84,7 @@ be soon), but for now you can check out this repository, run
libraryDependencies += "io.github.finagle" %% "finagle-serial-scodec" % "0.0.1"
```

Error handling
--------------
## Error handling

The most straightforward way to take care of application error handling is
simply to represent the possibility of error in your service's return type, and
Expand Down Expand Up @@ -143,8 +142,7 @@ Serial service:
`ApplicationError` (assuming it can't return the exception thrown by your
service).

Testing
-------
## Testing

We provide a `SerialIntegrationTest` that makes it easy to use [ScalaCheck][8]
to help verify that your serialization backend implementation is working
Expand Down Expand Up @@ -192,8 +190,7 @@ class ScodecIntegrationTest extends FunSuite with ScodecSerial with SerialIntegr

Check the `test` project documentation for more information about these tools.

Benchmarks
----------
## Benchmarks

We also provide a very preliminary `benchmark` project that uses [JMH][9] to
compare the performance of the Scodec backend to a similar Finagle Thrift
Expand All @@ -208,8 +205,7 @@ i.g.f.s.ScodecSmallRTBenchmark.test thrpt 20 8607.848 ± 244.8
These benchmarks (even more than most benchmarks) should be taken with a grain
of salt, but will be refined as the project matures.

License
-------
## License

Licensed under the **[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)** (the "License");
you may not use this software except in compliance with the License.
Expand Down
11 changes: 10 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import scoverage.ScoverageSbtPlugin.ScoverageKeys.coverageExcludedPackages

lazy val commonSettings = Seq(
organization := "io.github.finagle",
version := "0.0.1",
Expand Down Expand Up @@ -33,13 +35,16 @@ lazy val core = project
.settings(moduleName := "finagle-serial-core")
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.disablePlugins(CoverallsPlugin)

lazy val test = project
.settings(moduleName := "finagle-serial-test")
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(libraryDependencies ++= testDependencies)
.settings(coverageExcludedPackages := "io\\.github\\.finagle\\.serial\\.test\\..*")
.dependsOn(core)
.disablePlugins(CoverallsPlugin)

lazy val scodecSettings = Seq(
resolvers += Resolver.sonatypeRepo("snapshots"),
Expand All @@ -60,6 +65,7 @@ lazy val scodec = project
.settings(publishSettings: _*)
.settings(scodecSettings: _*)
.dependsOn(core, test % "it")
.disablePlugins(CoverallsPlugin)

lazy val benchmark = project
.settings(moduleName := "finagle-serial-benchmark")
Expand All @@ -72,8 +78,11 @@ lazy val benchmark = project
"com.twitter" %% "finagle-thriftmux" % "6.24.0",
"com.twitter" %% "scrooge-core" % "3.17.0"
)
).settings(com.twitter.scrooge.ScroogeSBT.newSettings: _*)
)
.settings(com.twitter.scrooge.ScroogeSBT.newSettings: _*)
.settings(coverageExcludedPackages := "i\\.g\\.f\\.s\\..*")
.dependsOn(core, scodec)
.disablePlugins(CoverallsPlugin)

lazy val publishSettings = Seq(
publishMavenStyle := true,
Expand Down
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ resolvers ++= Seq(
)

addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.1")

// Used only in the benchmark project
addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "3.14.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0.BETA1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.4")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.1.8")

// Used only in the benchmark project
addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "3.14.1")

0 comments on commit cef1708

Please sign in to comment.