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

Kover min boundary rule not overriding default value #618

Closed
sepehrvahedi opened this issue Jun 2, 2024 · 2 comments
Closed

Kover min boundary rule not overriding default value #618

sepehrvahedi opened this issue Jun 2, 2024 · 2 comments
Assignees
Labels
Bug Bug issue type S: waiting for clarification Status: additional information required to proceed

Comments

@sepehrvahedi
Copy link

I'm using Kover version 0.7.6 and JaCoCo version 0.8.10 or 0.8.12. When I run the ./gradlew check command on my device, the minimum boundary for line coverage set in my Kover configuration does not seem to be respected.

Here is my configuration:

kover {
  useJacoco("0.8.12") // or "0.8.10"
}

koverReport {
  filters {
    excludes {
      classes(
        "com.google.*",
        "grpc.gateway.protoc_gen_openapiv2.options.*",
      )
    }
  }
  verify {
    rule {
      isEnabled = true
      entity = GroupingEntityType.APPLICATION

      bound {
        metric = MetricType.LINE
        minValue = 67
        aggregation = AggregationType.COVERED_PERCENTAGE
      }
    }
  }
  defaults {
    xml {
      onCheck = true
    }
    log {
      onCheck = true
    }
  }
}

Despite setting the minimum boundary for line coverage to 67, I receive the following error when running the check:

Rule violated: lines covered percentage is 59.8300, but expected minimum is 67.0000
Rule violated: lines covered percentage is 59.8300, but expected minimum is 100.0000

It appears that Kover has a default minimum boundary of 100, and my configuration is not overriding this default value.

Steps to Reproduce

  1. Use Kover version 0.7.6.
  2. Use JaCoCo version 0.8.10 or 0.8.12.
  3. Configure Kover with the above settings.
  4. Run ./gradlew check.

Expected Behavior

The boundary set in the Kover configuration (minimum 67% line coverage) should override any default values.

Actual Behavior

The default minimum boundary of 100% seems to remain in effect, causing a rule violation error even though the custom boundary is set.

Additional Information

This issue might be caused by Kover not correctly applying the user-defined minimum boundary. Any insights or fixes for this issue would be appreciated.

@sepehrvahedi sepehrvahedi added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Jun 2, 2024
@shanshin
Copy link
Collaborator

shanshin commented Jun 5, 2024

Hi,
have you tried the Kover version 0.8.0?

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Jun 5, 2024
@shanshin
Copy link
Collaborator

Not reproduced in 0.8.1.

Feel free to create new issue if you have any additional questions or there will be other problems.

@shanshin shanshin closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants