Skip to content

chore: adjust code coverage percentage required #476

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

Merged
merged 1 commit into from
Oct 28, 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
2 changes: 1 addition & 1 deletion lesson_15/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please review the following resources before lecture:

### Unit Testing

For the code in the Lesson 15 app, you will write tests in the [unit tests project][unit-tests-link]. You must achieve a code coverage of 90% or more. The coverage report can be viewed at [./tdd/tdd_app/build/reports/jacoco/test/html/index.html][coverage-report] after running `./gradlew check` or `./gradlew jacocoTestReport`.
For the code in the Lesson 15 app, you will write tests in the [unit tests project][unit-tests-link]. You must achieve a code coverage of 80% or more. The coverage report can be viewed at [./tdd/tdd_app/build/reports/jacoco/test/html/index.html][coverage-report] after running `./gradlew check` or `./gradlew jacocoTestReport`.

In addition to writing unit tests, you will need to implement a new method on the `Employee` class called `getDetails` that returns a string describing the employee using the Test-Driven Development methodology.

Expand Down
13 changes: 13 additions & 0 deletions lesson_15/tdd/tdd_app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ tasks.jacocoTestReport {
}
}

tasks.jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = "0.8".toBigDecimal()
}
}
}
}

tasks.check {
dependsOn(tasks.jacocoTestCoverageVerification)
}

configure<com.diffplug.gradle.spotless.SpotlessExtension> {

Expand Down
Loading