Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
[WEAV-62] 커버리지 측정문제 해결 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfogSW authored Jan 29, 2024
1 parent 1327c39 commit 2d2911a
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CD - Dev
name: Develop Server Deployer (CD)

on: workflow_dispatch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI - Dev
name: Develop Server Integrator (CI)

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR title validation
name: Pull Request Validator

on:
pull_request:
Expand All @@ -9,13 +9,13 @@ permissions:
pull-requests: write

jobs:
pr-title-validation:
pr-validation:
runs-on: ubuntu-latest

name: Validate PR format
steps:
- uses: actions/checkout@v3

- name: check pr title format
- name: Check PR title format
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -36,5 +36,3 @@ jobs:
core.setFailed('PR 제목이 `[WEAV-번호]` 형식을 따르지 않습니다.')
return
}
// PR 제목이 형식을 따르면 아무 조치도 취하지 않음
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: SonarCloud
name: Unit Test Runner
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
Test-And-Analyze:
name: Run unit test and static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -34,4 +34,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew :bootstrap:http:build sonar --info
run: ./gradlew clean test testCodeCoverageReport sonar --info
28 changes: 27 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-test-fixtures`
id("jacoco")
id("jacoco-report-aggregation")
id("java-test-fixtures")
id("org.sonarqube") version Version.SONAR_CLOUD
id("org.springframework.boot") version Version.SPRING_BOOT
id("io.spring.dependency-management") version Version.SPRING_BOOT_DEPENDENCY_MANAGEMENT
Expand All @@ -20,6 +22,7 @@ allprojects {
}

subprojects {
apply(plugin = "jacoco")
apply(plugin = "java-test-fixtures")
apply(plugin = "org.sonarqube")
apply(plugin = "idea")
Expand Down Expand Up @@ -81,5 +84,28 @@ sonar {
property("sonar.projectKey", "Student-Center_weave-server")
property("sonar.organization", "student-center")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.java.coveragePlugin", "jacoco")
property("sonar.coverage.jacoco.xmlReportPaths", layout.projectDirectory.file("support/jacoco/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml"))
}
}


val allProjects = project.allprojects
.asSequence()
.filter { it.name != "weave-server" }
.filter { it.name != "support" }
.filter { it.name != "domain" }
.filter { it.name != "application" }
.filter { it.name != "infrastructure" }
.filter { it.name != "bootstrap" }
.toList()

project(":support:jacoco") {
apply(plugin = "jacoco-report-aggregation")

dependencies {
allProjects.forEach {
add("jacocoAggregation", project(it.path))
}
}
}
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ project(":support:mail").projectDir = file("support/mail")
include(":support:security")
project(":support:security").projectDir = file("support/security")

include(":support:jacoco")
project(":support:jacoco").projectDir = file("support/jacoco")

// domain
include(":domain")
project(":domain").projectDir = file("domain")
Expand Down
Empty file added support/jacoco/build.gradle.kts
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class JwtTokenProviderTest : DescribeSpec({
val secret = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc"
val anotherKey = "testtestetesttestetesttestetesttestetesttestetesttestetestteste"

it("BadRequestException 을 발생시킨다.") {
it("JWT_VERIFICATION_EXCEPTION 을 발생시킨다.") {
// arrange
val token: String = JwtTokenProvider.createToken(
jwtClaims = JwtClaims {
Expand All @@ -109,7 +109,7 @@ class JwtTokenProviderTest : DescribeSpec({

// assert
result.shouldBeInstanceOf<CustomException>()
result.type shouldBe JwtExceptionType.JWT_DECODE_EXCEPTION
result.type shouldBe JwtExceptionType.JWT_VERIFICATION_EXCEPTION
}
}

Expand Down

0 comments on commit 2d2911a

Please sign in to comment.