Skip to content

Commit 70e52f0

Browse files
authored
Merge pull request #2075 from vladak/jacoco-coveralls
run Jacoco and publish the results to Coveralls.io
2 parents ae2ffdd + 40a8ee6 commit 70e52f0

File tree

6 files changed

+52
-12
lines changed

6 files changed

+52
-12
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ env:
3939
# in 'script' no matter if an individual command fails or not. This kludgy
4040
# looking shell incantation takes care of that.
4141
#
42-
script: "mvn -B -V verify"
42+
script:
43+
- mvn -B -V verify jacoco:report org.eluder.coveralls:coveralls-maven-plugin:report
4344

4445
addons:
4546
coverity_scan:

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

2-
Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
33

44

5-
# OpenGrok - a wicked fast source browser [![Build Status](https://travis-ci.org/oracle/opengrok.svg?branch=master)](https://travis-ci.org/oracle/opengrok)
5+
# OpenGrok - a wicked fast source browser
6+
[![Build Status](https://travis-ci.org/oracle/opengrok.svg?branch=master)](https://travis-ci.org/oracle/opengrok)
7+
[![Coverage Status](https://coveralls.io/repos/oracle/opengrok/badge.svg?branch=master)](https://coveralls.io/r/oracle/opengrok?branch=master)
68

79
1. [Introduction](#1-introduction)
810
2. [Requirements](#2-requirements)

doc/release.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Release criteria
44
Ideally, the following minimum criteria should be fulfilled before a new
55
final (i.e. non-prerelease) version is released:
66

7-
- The code coverage for blocks must be at least 80%
7+
- The overall code coverage must be at least 70%
88
- No findbugs warnings
99
- No stoppers
1010
- All bugs and enhancements must be evaluated
@@ -19,7 +19,7 @@ Checklist for releasing OpenGrok:
1919

2020
1) sanity check:
2121

22-
- index
22+
- index fairly large code base, ideally multiple projects
2323
- deploy webapp
2424
- check UI:
2525
- history view
@@ -30,13 +30,9 @@ Checklist for releasing OpenGrok:
3030
- check sorting using multiple criteria
3131
- perform search using multiple fields across multiple projects
3232

33-
2) check all tests, tests code coverage:
34-
junit, pmd, findbugs, checkstyle, emma, jdepend
33+
2) check all tests pass, test code coverage is above given threshold
3534

36-
emma reports should be based according to what is set for the release,
37-
usually it's overall coverage above 80%.
38-
39-
Jenkins can help here.
35+
Additional tools to use: pmd, findbugs, checkstyle, jdepend
4036

4137
The release is OK, once above is fulfilled to our satisfaction.
4238

@@ -60,4 +56,5 @@ Checklist for releasing OpenGrok:
6056
of the release, e.g. adding list of issues fixed, whether complete reindex
6157
is necessary etc.
6258

63-
5) Send announcement to [email protected], Slack channel etc.
59+
5) Send announcement to [email protected],
60+
the #opengrok Slack channel etc.

opengrok-indexer/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
435435
<!-- Test helper class with name that confuses surefire -->
436436
<exclude>**/TestRepository.java</exclude>
437437
</excludes>
438+
<argLine>${surefireArgLine}</argLine>
438439
</configuration>
439440
</plugin>
440441

plugins/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
5858
<systemPropertyVariables>
5959
<junit-force-all>true</junit-force-all>
6060
</systemPropertyVariables>
61+
<argLine>${surefireArgLine}</argLine>
6162
</configuration>
6263
</plugin>
6364
</plugins>

pom.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,47 @@ Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
159159
<version>3.6.1</version>
160160
</plugin>
161161
<plugin>
162+
<!-- UNIT TEST RUNNER -->
162163
<groupId>org.apache.maven.plugins</groupId>
163164
<artifactId>maven-surefire-plugin</artifactId>
164165
<configuration>
165166
<forkCount>1</forkCount>
166167
<reuseForks>false</reuseForks>
167168
</configuration>
168169
<version>2.20</version>
170+
<executions>
171+
<execution>
172+
<id>run-unit-tests</id>
173+
<goals>
174+
<goal>test</goal>
175+
</goals>
176+
</execution>
177+
</executions>
169178
</plugin>
170179
<plugin>
171180
<groupId>org.jacoco</groupId>
172181
<artifactId>jacoco-maven-plugin</artifactId>
173182
<version>0.7.9</version>
183+
<executions>
184+
<!-- Prepare execution with Surefire -->
185+
<execution>
186+
<id>pre-unit-test</id>
187+
<goals>
188+
<goal>prepare-agent</goal>
189+
</goals>
190+
<configuration>
191+
<propertyName>surefireArgLine</propertyName>
192+
</configuration>
193+
</execution>
194+
<!-- Generate report after tests are run -->
195+
<execution>
196+
<id>post-unit-test</id>
197+
<phase>test</phase>
198+
<goals>
199+
<goal>report</goal>
200+
</goals>
201+
</execution>
202+
</executions>
174203
</plugin>
175204
<plugin>
176205
<groupId>org.apache.maven.plugins</groupId>
@@ -260,7 +289,16 @@ Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
260289
<groupId>org.apache.maven.plugins</groupId>
261290
<artifactId>maven-surefire-report-plugin</artifactId>
262291
<version>2.20</version>
292+
<configuration>
293+
<argLine>${surefireArgLine}</argLine>
294+
</configuration>
263295
</plugin>
296+
<!-- CODE COVERAGE PUBLISHER -->
297+
<plugin>
298+
<groupId>org.eluder.coveralls</groupId>
299+
<artifactId>coveralls-maven-plugin</artifactId>
300+
<version>3.1.0</version>
301+
</plugin>
264302
<plugin>
265303
<groupId>org.apache.maven.plugins</groupId>
266304
<artifactId>maven-jxr-plugin</artifactId>

0 commit comments

Comments
 (0)