Skip to content

Commit e04edaf

Browse files
authored
[tools] chore(ci): add warning for test coverage
1 parent f16f6ee commit e04edaf

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

.codecov.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 50%
6+
threshold: 0
7+
informational: true
8+
patch:
9+
default:
10+
target: 50%
11+
threshold: 0
12+
informational: true

.drone.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ steps:
2121
- mvn clean install -q -DskipTests
2222
- cd openaev-api
2323
- mvn test
24+
- echo "Running coverage validation..."
25+
- mvn jacoco:check || echo "⚠️ Coverage threshold check ⚠️"
2426
- cd ../openaev-framework
2527
- mvn test
2628

.github/workflows/validate-pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
2121
# Regex for:
2222
# [category/subcategory] type(scope?): description (#123?)
23-
PATTERN='^\[([a-z]+(/[a-z]+)*)\] (feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)(\([a-z]+\))?: [a-z].*( \(#[0-9]+\))$'
23+
PATTERN='^\[([a-z]+(/[a-z]+)*)\] (feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)(\([a-z-]+\))?: [a-z].*( \(#[0-9]+\))$'
2424
2525
if [[ ! "$TITLE" =~ $PATTERN ]]; then
2626
echo "❌ Invalid PR title."

openaev-api/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,26 @@
326326
<groupId>org.jacoco</groupId>
327327
<artifactId>jacoco-maven-plugin</artifactId>
328328
<version>${jacoco-plugin.version}</version>
329+
<configuration>
330+
<haltOnFailure>false</haltOnFailure>
331+
<rules>
332+
<rule>
333+
<element>BUNDLE</element>
334+
<limits>
335+
<limit>
336+
<counter>LINE</counter>
337+
<value>COVEREDRATIO</value>
338+
<minimum>0.50</minimum> <!-- 50% minimum coverage -->
339+
</limit>
340+
<limit>
341+
<counter>BRANCH</counter>
342+
<value>COVEREDRATIO</value>
343+
<minimum>0.30</minimum>
344+
</limit>
345+
</limits>
346+
</rule>
347+
</rules>
348+
</configuration>
329349
<executions>
330350
<execution>
331351
<goals>
@@ -339,6 +359,14 @@
339359
<goal>report</goal>
340360
</goals>
341361
</execution>
362+
<!-- Enforce coverage threshold -->
363+
<execution>
364+
<id>check</id>
365+
<phase>verify</phase>
366+
<goals>
367+
<goal>check</goal>
368+
</goals>
369+
</execution>
342370
</executions>
343371
</plugin>
344372
<plugin>

0 commit comments

Comments
 (0)