You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stormcrawler.apache.org by jn...@apache.org on 2024/09/05 17:23:44 UTC

(incubator-stormcrawler) branch main updated: SC-1162: Replace Coveralls with JaCoCo (#1255)

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

jnioche pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-stormcrawler.git


The following commit(s) were added to refs/heads/main by this push:
     new e1152f48 SC-1162: Replace Coveralls with JaCoCo (#1255)
e1152f48 is described below

commit e1152f48a61e35a315754be5093f553524e7b19b
Author: Dávid Szigecsán <si...@gmail.com>
AuthorDate: Thu Sep 5 19:23:40 2024 +0200

    SC-1162: Replace Coveralls with JaCoCo (#1255)
---
 .github/workflows/code_coverage.yml | 44 ------------------------------
 .github/workflows/maven.yml         |  2 +-
 README.md                           |  1 -
 core/pom.xml                        |  7 +++++
 external/opensearch/pom.xml         |  7 +++++
 external/playwright/pom.xml         |  7 +++++
 external/tika/pom.xml               | 10 +++++++
 external/urlfrontier/pom.xml        |  7 +++++
 external/warc/pom.xml               |  7 +++++
 pom.xml                             | 53 +++++++++++++++++++++++++++++++++++++
 10 files changed, 99 insertions(+), 46 deletions(-)

diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml
deleted file mode 100644
index 9809e0bf..00000000
--- a/.github/workflows/code_coverage.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-# 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.
-
-name: Code Coverage
-
-on:
-  pull_request:
-  push:
-    branches:
-      - master
-jobs:
-  build:
-    name: Coveralls
-    runs-on: ubuntu-latest
-
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v3
-        with:
-          persist-credentials: false
-      - name: Set up JDK 11
-        uses: actions/setup-java@v3
-        with:
-          distribution: adopt
-          java-version: 11
-      - name: Build & test with Maven and coverage
-        run: mvn -B --no-transfer-progress clean test
-      - name: Post to Coveralls
-        uses: coverallsapp/github-action@v2
-        with:
-          github-token: ${{ secrets.GITHUB_TOKEN }}
-          format: jacoco
\ No newline at end of file
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 9ebd3253..84020e6b 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -56,4 +56,4 @@ jobs:
         distribution: adopt
         java-version: ${{ matrix.java }}
     - name: Build with Maven
-      run: mvn -B --no-transfer-progress package --file pom.xml -DCI_ENV=true
+      run: mvn -B --no-transfer-progress package --file pom.xml -DCI_ENV=true verify
diff --git a/README.md b/README.md
index a202a349..92016de6 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,6 @@
 [![license](https://img.shields.io/github/license/apache/incubator-stormcrawler.svg?maxAge=2592000?style=plastic)](http://www.apache.org/licenses/LICENSE-2.0)
 ![Build Status](https://github.com/apache/incubator-stormcrawler/actions/workflows/maven.yml/badge.svg)
 [![javadoc](https://javadoc.io/badge2/apache/incubator-stormcrawler-core/javadoc.svg)](https://javadoc.io/doc/org.apache.stormcrawler/stormcrawler-core/)
-[![Coverage Status](https://coveralls.io/repos/github/apache/incubator-stormcrawler/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-stormcrawler?branch=master)
 
 Apache StormCrawler (Incubating) is an open source collection of resources for building low-latency, scalable web crawlers on [Apache Storm](http://storm.apache.org/). It is provided under [Apache License](http://www.apache.org/licenses/LICENSE-2.0) and is written mostly in Java.
 
diff --git a/core/pom.xml b/core/pom.xml
index 265c0159..ff9e835e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -52,6 +52,13 @@ under the License.
 		<caffeine.version>3.1.8</caffeine.version>
 		<xsoup.version>0.3.7</xsoup.version>
 		<awaitility.version>4.2.0</awaitility.version>
+		<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
+		<jacoco.classRatio>0.73</jacoco.classRatio>
+		<jacoco.instructionRatio>0.56</jacoco.instructionRatio>
+		<jacoco.methodRatio>0.62</jacoco.methodRatio>
+		<jacoco.branchRatio>0.50</jacoco.branchRatio>
+		<jacoco.lineRatio>0.56</jacoco.lineRatio>
+		<jacoco.complexityRatio>0.44</jacoco.complexityRatio>
 	</properties>
 
 	<build>
diff --git a/external/opensearch/pom.xml b/external/opensearch/pom.xml
index 52f5c572..c2dc06aa 100644
--- a/external/opensearch/pom.xml
+++ b/external/opensearch/pom.xml
@@ -31,6 +31,13 @@ under the License.
 
 	<properties>
 		<opensearch.version>2.12.0</opensearch.version>
+		<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
+		<jacoco.classRatio>0.27</jacoco.classRatio>
+		<jacoco.instructionRatio>0.27</jacoco.instructionRatio>
+		<jacoco.methodRatio>0.25</jacoco.methodRatio>
+		<jacoco.branchRatio>0.17</jacoco.branchRatio>
+		<jacoco.lineRatio>0.29</jacoco.lineRatio>
+		<jacoco.complexityRatio>0.13</jacoco.complexityRatio>
 	</properties>
 
 	<artifactId>stormcrawler-opensearch</artifactId>
diff --git a/external/playwright/pom.xml b/external/playwright/pom.xml
index 4486474b..d9fbe367 100644
--- a/external/playwright/pom.xml
+++ b/external/playwright/pom.xml
@@ -40,6 +40,13 @@ under the License.
 		<playwright.version>1.43.0</playwright.version>
 		<awaitility.version>4.2.1</awaitility.version>
 		<wiremock.version>3.5.4</wiremock.version>
+		<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
+		<jacoco.classRatio>0.00</jacoco.classRatio>
+		<jacoco.instructionRatio>0.00</jacoco.instructionRatio>
+		<jacoco.methodRatio>0.00</jacoco.methodRatio>
+		<jacoco.branchRatio>0.00</jacoco.branchRatio>
+		<jacoco.lineRatio>0.00</jacoco.lineRatio>
+		<jacoco.complexityRatio>0.00</jacoco.complexityRatio>
 	</properties>
 
 	<dependencies>
diff --git a/external/tika/pom.xml b/external/tika/pom.xml
index de385260..12206d3f 100644
--- a/external/tika/pom.xml
+++ b/external/tika/pom.xml
@@ -36,6 +36,16 @@ under the License.
 	<url>https://github.com/apache/incubator-stormcrawler/tree/master/external/tika</url>
 	<description>Tika-based parser bolt for StormCrawler</description>
 
+	<properties>
+		<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
+		<jacoco.classRatio>0.25</jacoco.classRatio>
+		<jacoco.instructionRatio>0.36</jacoco.instructionRatio>
+		<jacoco.methodRatio>0.14</jacoco.methodRatio>
+		<jacoco.branchRatio>0.20</jacoco.branchRatio>
+		<jacoco.lineRatio>0.37</jacoco.lineRatio>
+		<jacoco.complexityRatio>0.13</jacoco.complexityRatio>
+	</properties>
+
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.tika</groupId>
diff --git a/external/urlfrontier/pom.xml b/external/urlfrontier/pom.xml
index 8d13e4bb..ca41a5dd 100644
--- a/external/urlfrontier/pom.xml
+++ b/external/urlfrontier/pom.xml
@@ -38,6 +38,13 @@ under the License.
 
 	<properties>
 		<urlfrontier.version>2.3.1</urlfrontier.version>
+		<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
+		<jacoco.classRatio>0.50</jacoco.classRatio>
+		<jacoco.instructionRatio>0.51</jacoco.instructionRatio>
+		<jacoco.methodRatio>0.53</jacoco.methodRatio>
+		<jacoco.branchRatio>0.45</jacoco.branchRatio>
+		<jacoco.lineRatio>0.47</jacoco.lineRatio>
+		<jacoco.complexityRatio>0.35</jacoco.complexityRatio>
 	</properties>
 
 	<build>
diff --git a/external/warc/pom.xml b/external/warc/pom.xml
index 98f46ef9..b5bde641 100644
--- a/external/warc/pom.xml
+++ b/external/warc/pom.xml
@@ -39,6 +39,13 @@ under the License.
 	<properties>
 		<commons-codec.version>1.10</commons-codec.version>
 		<jwarc.version>0.29.0</jwarc.version>
+		<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
+		<jacoco.classRatio>0.75</jacoco.classRatio>
+		<jacoco.instructionRatio>0.65</jacoco.instructionRatio>
+		<jacoco.methodRatio>0.68</jacoco.methodRatio>
+		<jacoco.branchRatio>0.54</jacoco.branchRatio>
+		<jacoco.lineRatio>0.66</jacoco.lineRatio>
+		<jacoco.complexityRatio>0.41</jacoco.complexityRatio>
 	</properties>
 
 	<dependencies>
diff --git a/pom.xml b/pom.xml
index 7ae03a1b..149f4bea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,6 +74,13 @@ under the License.
 		<testcontainers.version>1.19.7</testcontainers.version>
 		<maven.mojo.license.plugin>2.4.0</maven.mojo.license.plugin>
 		<jacoco.maven.plugin>0.8.11</jacoco.maven.plugin>
+		<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
+		<jacoco.classRatio>1.00</jacoco.classRatio>
+		<jacoco.instructionRatio>1.00</jacoco.instructionRatio>
+		<jacoco.methodRatio>1.00</jacoco.methodRatio>
+		<jacoco.branchRatio>1.00</jacoco.branchRatio>
+		<jacoco.lineRatio>1.00</jacoco.lineRatio>
+		<jacoco.complexityRatio>1.00</jacoco.complexityRatio>
 
 		<skip.format.code>true</skip.format.code>
 	</properties>
@@ -262,6 +269,52 @@ under the License.
 							<goal>report</goal>
 						</goals>
 					</execution>
+					<execution>
+						<id>check</id>
+						<goals>
+							<goal>check</goal>
+						</goals>
+						<configuration>
+							<rules>
+								<rule>
+									<element>BUNDLE</element>
+									<limits>
+										<limit>
+											<counter>CLASS</counter>
+											<value>COVEREDRATIO</value>
+											<minimum>${jacoco.classRatio}</minimum>
+										</limit>
+										<limit>
+											<counter>INSTRUCTION</counter>
+											<value>COVEREDRATIO</value>
+											<minimum>${jacoco.instructionRatio}</minimum>
+										</limit>
+										<limit>
+											<counter>METHOD</counter>
+											<value>COVEREDRATIO</value>
+											<minimum>${jacoco.methodRatio}</minimum>
+										</limit>
+										<limit>
+											<counter>BRANCH</counter>
+											<value>COVEREDRATIO</value>
+											<minimum>${jacoco.branchRatio}</minimum>
+										</limit>
+										<limit>
+											<counter>LINE</counter>
+											<value>COVEREDRATIO</value>
+											<minimum>${jacoco.lineRatio}</minimum>
+										</limit>
+										<limit>
+											<counter>COMPLEXITY</counter>
+											<value>COVEREDRATIO</value>
+											<minimum>${jacoco.complexityRatio}</minimum>
+										</limit>
+									</limits>
+								</rule>
+							</rules>
+							<haltOnFailure>${jacoco.haltOnFailure}</haltOnFailure>
+						</configuration>
+					</execution>
 				</executions>
 			</plugin>
 			<plugin>