Kover: add verify rules: global and for Presenters
This commit is contained in:
parent
8b599a6549
commit
312cc4ce22
2 changed files with 40 additions and 0 deletions
9
.github/workflows/quality.yml
vendored
9
.github/workflows/quality.yml
vendored
|
|
@ -29,6 +29,15 @@ jobs:
|
||||||
name: linting-report
|
name: linting-report
|
||||||
path: |
|
path: |
|
||||||
*/build/reports/**/*.*
|
*/build/reports/**/*.*
|
||||||
|
- name: Check Kover rules
|
||||||
|
run: ./gradlew koverMergedVerify $CI_GRADLE_ARG_PROPERTIES
|
||||||
|
- name: Upload reports
|
||||||
|
if: failure()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kover-report
|
||||||
|
path: |
|
||||||
|
*/build/reports/kover/merged/verification/errors.txt
|
||||||
- name: Prepare Danger
|
- name: Prepare Danger
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -174,4 +174,35 @@ koverMerged {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run ./gradlew koverMergedVerify to check the rules.
|
||||||
|
verify {
|
||||||
|
// Does not seems to work, so also run the task manually on the workflow.
|
||||||
|
onCheck.set(true)
|
||||||
|
// General rule: minimum code coverage.
|
||||||
|
rule {
|
||||||
|
name = "Global minimum code coverage."
|
||||||
|
target = kotlinx.kover.api.VerificationTarget.ALL
|
||||||
|
bound {
|
||||||
|
minValue = 35
|
||||||
|
// Setting a max value, so that if coverage is bigger, it means that we have to change minValue.
|
||||||
|
maxValue = 40
|
||||||
|
counter = kotlinx.kover.api.CounterType.LINE
|
||||||
|
valueType = kotlinx.kover.api.VerificationValueType.COVERED_PERCENTAGE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Rule to ensure that coverage of Presenters is sufficient.
|
||||||
|
rule {
|
||||||
|
name = "Check code coverage of presenters"
|
||||||
|
target = kotlinx.kover.api.VerificationTarget.CLASS
|
||||||
|
overrideClassFilter {
|
||||||
|
includes += "*Presenter"
|
||||||
|
}
|
||||||
|
bound {
|
||||||
|
minValue = 80
|
||||||
|
counter = kotlinx.kover.api.CounterType.LINE
|
||||||
|
valueType = kotlinx.kover.api.VerificationValueType.COVERED_PERCENTAGE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue