Skip to content

Commit

Permalink
[chore]: test CI 수정 (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssssujini99 authored Jan 2, 2024
1 parent 5ab90d7 commit ebfb6a4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 100 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,4 @@ jobs:
- name: test CI
uses: gradle/gradle-build-action@v2
with:
arguments: clean test jacocoTestReport jacocoTestCoverageVerification

- name: Add coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.6.1
with:
paths: |
${{ github.workspace }}/interpark/api/build/reports/jacoco/jacocoTestReport.xml,
${{ github.workspace }}/interpark/core/build/reports/jacoco/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: '# :lobster: Test Coverage Report'
pass-emoji: ':green_circle:'
fail-emoji: ':red_circle:'
arguments: clean test
117 changes: 30 additions & 87 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,94 +1,37 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
}

subprojects {

apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: "java-test-fixtures"
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "java-test-fixtures"

group = 'dev.hooon'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

repositories {
mavenCentral()
}

// 공통 dependencies
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-validation'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
useJUnitPlatform()
}

group = 'dev.hooon'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

repositories {
mavenCentral()
}

// 공통 dependencies
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-validation'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
useJUnitPlatform()
finalizedBy 'jacocoTestReport' // test 이후 커버리지 실행
}

jacoco {
toolVersion = '0.8.8'
}

jacocoTestReport {
reports {
xml.required = true
html.required = true
}

def Qdomains = []

for (qPattern in '**/QA'..'**/QZ') { // qPattern = '*.QA', '*.QB', ... '*.QZ'
Qdomains.add(qPattern + '*')
}

afterEvaluate { // report 제외대상 지정
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [] + Qdomains)
})
)
}

finalizedBy 'jacocoTestCoverageVerification' // 커버리지 이후에 평가
}

jacocoTestCoverageVerification { // 커버리지 상세설정
def Qdomains = []

for (qPattern in '*.QA'..'*.QZ') { // qPattern = '*.QA', '*.QB', ... '*.QZ'
Qdomains.add(qPattern + '*')
}

violationRules {
rule {
enabled = true
element = 'CLASS'

limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.0
}

limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.0
}

excludes = [] + Qdomains // 커버리지 평가 제외 대상
}
}
}
}

0 comments on commit ebfb6a4

Please sign in to comment.