Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jacoco coverrage Threshold rouding error #10900

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1292,14 +1292,14 @@
<element>CLASS</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>1.00</minimum>
<counter>BRANCH</counter>
Copy link
Contributor

@murdos murdos Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it becomes a duplicated limit of the limit that is defined below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what's your suggestion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I've not done any investigation to fix the mentioned issue.
I'm just noticing that this limit is already defined.
Maybe @DamnClin know better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to go from

<value>COVEREDRATIO</value>
<minimum>1.00</minimum>

To

<value>MISSEDCOUNT</value>
<maximum>0</maximum>

For both banch and line, I missed copy past in the ticket, forgot to remove the failing part...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qmonmert : That means COVEREDRATIO limits should be removed

<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>1.00</minimum>
<counter>LINE</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
</limits>
</rule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ private static MavenPlugin mavenJacocoWithMinCoverageCheckPluginManagement() {
<element>CLASS</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>1.00</minimum>
<counter>BRANCH</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>1.00</minimum>
<counter>LINE</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
</limits>
</rule>
Expand Down Expand Up @@ -199,14 +199,14 @@ private static GradleMainBuildPlugin gradleJacocoWithMinCoverageCheckPlugin() {

limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = "1.00".toBigDecimal()
value = "MISSEDCOUNT"
maximum = "0.00".toBigDecimal()
}

limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = "1.00".toBigDecimal()
value = "MISSEDCOUNT"
maximum = "0.00".toBigDecimal()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/features/server/javatool/jacoco.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Feature: Jacoco module

Scenario: Should apply jacoco with min coverage check module
When I apply "jacoco-with-min-coverage-check" module to default project with maven file without parameters
Then I should have "<value>COVEREDRATIO</value>" in "pom.xml"
Then I should have "<value>MISSEDCOUNT</value>" in "pom.xml"
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ void shouldBuildJacocoWithMinCoverageCheckModule() {
<element>CLASS</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>1.00</minimum>
<counter>BRANCH</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>1.00</minimum>
<counter>LINE</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
</limits>
</rule>
Expand Down Expand Up @@ -228,14 +228,14 @@ void shouldBuildJacocoWithMinCoverageCheckModule() {

limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = "1.00".toBigDecimal()
value = "MISSEDCOUNT"
maximum = "0.00".toBigDecimal()
}

limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = "1.00".toBigDecimal()
value = "MISSEDCOUNT"
maximum = "0.00".toBigDecimal()
}
}
}
Expand Down