Config coverage validation rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
// 'element'가 없으면 프로젝트의 전체 파일을 합친 값을 기준으로 한다. | |
limit { | |
// 'counter'를 지정하지 않으면 default는 'INSTRUCTION' | |
// 'value'를 지정하지 않으면 default는 'COVEREDRATIO' | |
minimum = 0.30 | |
} | |
} | |
rule { | |
// 룰을 간단히 켜고 끌 수 있다. | |
enabled = true | |
// 룰을 체크할 단위는 클래스 단위 | |
element = 'CLASS' | |
// 브랜치 커버리지를 최소한 90% 만족시켜야 한다. | |
limit { | |
counter = 'BRANCH' | |
value = 'COVEREDRATIO' | |
minimum = 0.90 | |
} | |
// 라인 커버리지를 최소한 80% 만족시켜야 한다. | |
limit { | |
counter = 'LINE' | |
value = 'COVEREDRATIO' | |
minimum = 0.80 | |
} | |
// 빈 줄을 제외한 코드의 라인수를 최대 200라인으로 제한한다. | |
limit { | |
counter = 'LINE' | |
value = 'TOTALCOUNT' | |
maximum = 200 | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kotlin DSL | |
tasks.jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
// 'element'가 없으면 프로젝트의 전체 파일을 합친 값을 기준으로 합니다. | |
limit { | |
// 'counter'를 지정하지 않으면 default는 'INSTRUCTION' | |
// 'value'를 지정하지 않으면 default는 'COVEREDRATIO' | |
minimum = "0.30".toBigDecimal() | |
} | |
} | |
// 여러 룰을 생성할 수 있습니다. | |
rule { | |
// 룰을 간단히 켜고 끌 수 있습니다. | |
enabled = true | |
// 룰을 체크할 단위는 클래스 단위 | |
element = "CLASS" | |
// 브랜치 커버리지를 최소한 90% 만족시켜야 합니다. | |
limit { | |
counter = "BRANCH" | |
value = "COVEREDRATIO" | |
minimum = "0.90".toBigDecimal() | |
} | |
// 라인 커버리지를 최소한 80% 만족시켜야 합니다. | |
limit { | |
counter = "LINE" | |
value = "COVEREDRATIO" | |
minimum = "0.80".toBigDecimal() | |
} | |
// 빈 줄을 제외한 코드의 라인수를 최대 200라인으로 제한합니다. | |
limit { | |
counter = "LINE" | |
value = "TOTALCOUNT" | |
maximum = "200".toBigDecimal() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment