Merge pull request #1227 from OpenRefine/coverage

Add test coverage and code analysis reports with Codacy
This commit is contained in:
Antonin Delpeuch 2017-08-03 19:30:41 +01:00 committed by GitHub
commit e7ca800d61
4 changed files with 44 additions and 8 deletions

View File

@ -3,4 +3,15 @@ jdk:
- oraclejdk8
- openjdk7
script: ./refine test
env:
# encrypted Codacy key, see https://docs.travis-ci.com/user/encryption-keys/
- secure: "VmS4He99YlI6rdmw8Q25OZ9kUp11sRbt0W1QMBvA5lzNSmhN1Q1KtaMj9AGwpCZWcyGWri4AQxEmloARxACxQHXRmNE7ro2DESGw46RAocBAf+RfBxYTifIyUGu5TnSCQhz56SkgpyWpedZAZWyah9ZxgUMfet4KXFUfeiUgYQA="
before_install:
- wget -O ~/codacy-coverage-reporter-assembly-latest.jar https://github.com/codacy/codacy-coverage-reporter/releases/download/2.0.0/codacy-coverage-reporter-2.0.0-assembly.jar
script: ./refine server_test
after_success:
- java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r build/report/jacoco.xml

View File

@ -1,6 +1,6 @@
# OpenRefine
[![Build Status](https://travis-ci.org/OpenRefine/OpenRefine.png?branch=master)](https://travis-ci.org/OpenRefine/OpenRefine) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=32795)](https://www.bountysource.com/trackers/32795-open-refine?utm_source=32795&utm_medium=shield&utm_campaign=TRACKER_BADGE)
[![Build Status](https://travis-ci.org/OpenRefine/OpenRefine.png?branch=master)](https://travis-ci.org/OpenRefine/OpenRefine) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/210578308bba42c5922c767493e83cf4)](https://www.codacy.com/app/OpenRefine/OpenRefine) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=32795)](https://www.bountysource.com/trackers/32795-open-refine?utm_source=32795&utm_medium=shield&utm_campaign=TRACKER_BADGE)
OpenRefine is a power tool that allows you to load data, understand it,
clean it up, reconcile it, and augment it with data coming from

View File

@ -6,7 +6,7 @@
|
+-->
<project name="openrefine" default="build" basedir=".">
<project name="openrefine" default="build" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<!-- Properties are immutable, so anything set in this file takes priority-->
<property file="build.properties"/>
@ -49,6 +49,9 @@
<property name="server.tests.lib.dir" value="${server.tests.dir}/lib" />
<property name="server.tests.src.dir" value="${server.tests.dir}/src" />
<property name="server.tests.classes.dir" value="${server.tests.dir}/classes" />
<property name="server.tests.report.dir" value="${build.dir}/report"/>
<property name="server.tests.report.html.dir" value="${server.tests.report.dir}/html"/>
<property name="server.tests.report.xml.path" value="${server.tests.report.dir}/jacoco.xml"/>
<property name="graphics.dir" value="${basedir}/graphics" />
<property name="conf.dir" value="${basedir}/conf" />
@ -171,13 +174,35 @@
<target name="build_broker" depends="build_broker_core, build_broker_appengine"/>
<taskdef resource="testngtasks" classpath="${server.tests.lib.dir}/testng-6.8.jar"/>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${server.tests.lib.dir}/jacocoant.jar"/>
</taskdef>
<mkdir dir="${build.dir}/server_tests"/>
<target name="server_test" depends="build_tests">
<jacoco:coverage destfile="${server.tests.report.dir}/jacoco.exec">
<testng verbose="2" haltOnFailure="true" workingdir="${build.dir}/server_tests"
listener="org.testng.reporters.DotTestListener" excludedgroups="broken"
classpathref="tests.class.path">
<xmlfileset file="${server.tests.dir}/conf/tests.xml"/>
</testng>
</jacoco:coverage>
<jacoco:report>
<executiondata>
<file file="${server.tests.report.dir}/jacoco.exec"/>
</executiondata>
<structure name="OpenRefine server">
<classfiles>
<fileset dir="${webapp.classes.dir}"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${server.src.dir}"/>
</sourcefiles>
</structure>
<html destdir="${server.tests.report.html.dir}"/>
<xml destfile="${server.tests.report.xml.path}"/>
</jacoco:report>
</target>
<!-- ================================================================== -->

Binary file not shown.