You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by ja...@apache.org on 2019/02/15 18:45:36 UTC

[incubator-daffodil] branch master updated: Added sbt-scoverage code coverage reporting

This is an automated email from the ASF dual-hosted git repository.

jadams pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-daffodil.git


The following commit(s) were added to refs/heads/master by this push:
     new de74c03  Added sbt-scoverage code coverage reporting
de74c03 is described below

commit de74c03544cf636b06196106a73ddc0a6bb52a92
Author: Josh Adams <ja...@tresys.com>
AuthorDate: Fri Feb 15 09:28:41 2019 -0500

    Added sbt-scoverage code coverage reporting
    
    Also added support for sbt-scoverage to the Travis CI configuration, as
    well as the uploading of reports to codecov.io
    
    DAFFODIL-2003
---
 .codecov.yml        | 17 +++++++++++++++++
 .travis.yml         |  7 +++++--
 README.md           | 10 ++++++++++
 project/plugins.sbt |  2 ++
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/.codecov.yml b/.codecov.yml
new file mode 100644
index 0000000..e790c7f
--- /dev/null
+++ b/.codecov.yml
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Prevents codecov from creating a test coverage comment in a pull request
+comment: off
diff --git a/.travis.yml b/.travis.yml
index d752c66..4a0a01e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,11 +31,14 @@ before_script:
   - unset _JAVA_OPTIONS
 script:
   - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION compile test:compile it:compile debug:compile || travis_terminate 1
-  - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION test
-  - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION it:test
+  - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION coverage test
+  - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION coverage it:test
   - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION daffodil-cli/universal:packageBin
   - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION daffodil-cli/universal:packageZipTarball
   - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION daffodil-cli/rpm:packageBin
   - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION daffodil-japi/genjavadoc:doc
   - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION daffodil-sapi/doc
   - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION ratCheck
+  - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION coverageReport
+  - sbt -J-Xms1g -J-Xmx5g ++$TRAVIS_SCALA_VERSION coverageAggregate
+  - bash <(curl -s https://codecov.io/bash)
diff --git a/README.md b/README.md
index f00066a..8348e30 100644
--- a/README.md
+++ b/README.md
@@ -74,6 +74,16 @@ This following command generates an [Apache RAT](https://creadur.apache.org/rat/
 $ sbt ratCheck
 ```
 
+### Test Coverage Report
+
+This follow commands generate an [sbt-scoverage](https://github.com/scoverage/sbt-scoverage) test coverage report that will be located in ``target/scala-ver/scoverage-report/``.
+
+```bash
+$ sbt clean coverage test it:test
+$ sbt coverageReport
+$ sbt coverageAggregate
+```
+
 ## Getting Help
 
 For questions, we can be reached at the dev@daffodil.apache.org or user@daffodil.apache.org mailing lists or in #Daffodil on [ASF HipChat](https://www.hipchat.com/gJt9EQs5l). Bugs can be reported via the [Daffodil JIRA](https://issues.apache.org/jira/projects/DAFFODIL).
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 5d722fc..7fd022b 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -19,6 +19,8 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.17")
 
 addSbtPlugin("org.musigma" % "sbt-rat" % "0.6.0")
 
+addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
+
 // Both sbt and the sbt-native-pacakger plugin have transitive dependencies to
 // different versions of plexus-utils and guava, but with different major
 // version numbers. SBT interprets this major version number difference as