Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
68dabfc
config: DB integration test용 초기화코드 추가
Junh-b May 25, 2025
15d0b5b
add: MariaDB 통합테스트용 Extension, Base Test 정의
Junh-b May 25, 2025
63ab22f
test: MariaDB Base테스트 기반, AssetRepositoryTest 샘플 추가
Junh-b May 25, 2025
de40d21
config: testcontainers library 추가
Junh-b May 26, 2025
cde99ba
add: mvctest용 user mocking annotation 추가
Junh-b May 26, 2025
e344c27
add: Controller 테스트의 Base 테스트를 추가했습니다.
Junh-b May 26, 2025
4f236bb
test: AssetControllerTest 샘플 테스트코드 추가
Junh-b May 26, 2025
21c90b7
config: spring-security-test 추가
Junh-b May 26, 2025
08b7597
add: WebSocketTest Base 테스트 추가
Junh-b May 26, 2025
df47199
fix: DBInitRunner 작동 조건 수정
Junh-b May 26, 2025
66ffcd9
test: OrderBook Websocket Sample 테스트코드 추가
Junh-b May 26, 2025
74c6984
Merge branch 'dev' into feat/test-fixture
Junh-b May 26, 2025
c4cdaf0
fix: base 테스트 코드에 TimeZoneConfig 추가
Junh-b May 26, 2025
10c3a38
Merge branch 'dev' into feat/test-fixture
Junh-b May 29, 2025
2950b6b
fix: MariaDBTest transaction 병목 issue 해결
Junh-b May 29, 2025
86ed452
config: db 통합테스트를 자동화 테스트 대상에서 제외
Junh-b May 29, 2025
d509a81
Merge branch 'dev' into feat/test-fixture
Junh-b May 30, 2025
2a853cb
test: 체결 통합 테스트 프로필 설정 추가
Junh-b May 30, 2025
dfd0352
fix: testcontainers test 전체 테스트 대상에서 제외
Junh-b May 30, 2025
0d19ebc
config: 개발환경 편의성을 위한 jacoco 설정변경
Junh-b May 30, 2025
4e45d89
fix: 임시로 websocket 테스트 비활성화
Junh-b May 30, 2025
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
33 changes: 24 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ repositories {
mavenCentral()
}

jacoco { //추가함
toolVersion = "0.8.13"
}

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

// afterEvaluate {
// getClassDirectories().setFrom(files(classDirectories.files.collect{
// fileTree(dir : it, includes: [
// "com/cleanengine/coin/realitybot/**"
// ])
// }))
// }
}

dependencies {

implementation 'org.springframework.boot:spring-boot-starter-websocket' // WS + STOMP
Expand Down Expand Up @@ -53,6 +73,7 @@ dependencies {
testImplementation 'org.testcontainers:mariadb'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

testImplementation 'org.junit.platform:junit-platform-suite:1.10.0'
// Spring Security + OAuth2
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
Expand All @@ -64,16 +85,10 @@ dependencies {
}

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

jacocoTestReport {
reports {
xml.required = true
html.required = true
useJUnitPlatform{
excludeTags 'testcontainers'
}
dependsOn test
finalizedBy jacocoTestReport
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depensOn 대신 finalizedBy 사용 시, 테스트가 실패해도 SonarQube에서 항상 커버리지 리포트를 볼 수 있다는 장점이 있네요

}

sonar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
Expand All @@ -22,6 +23,7 @@
*/
@DataJpaTest
@Disabled
@Tag("testcontainers")
@ActiveProfiles({"dev", "it"})
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@ExtendWith(MariaDBTestContainerExtension.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.cleanengine.coin.orderbook.dto.OrderBookInfo;
import com.cleanengine.coin.orderbook.dto.OrderBookUnitInfo;
import com.cleanengine.coin.tool.helper.GenericStompFrameHandler;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

Expand All @@ -12,6 +13,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

@Disabled
public class OrderBookUpdatedNotifierAdapterTest extends WebSocketTest {

@Autowired
Expand All @@ -28,7 +30,7 @@ public void getOrderBooks() throws Exception {

orderBookUpdatedNotifierAdapter.sendOrderBooks(orderBookInfo);

OrderBookInfo result = (OrderBookInfo) responseQueue.poll(5, TimeUnit.SECONDS);
OrderBookInfo result = (OrderBookInfo) responseQueue.poll(10, TimeUnit.SECONDS);

assertEquals(orderBookInfo, result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

import java.time.LocalDateTime;
import java.util.List;
Expand All @@ -28,6 +29,7 @@
import static org.junit.jupiter.api.Assertions.*;

@SpringBootTest
@ActiveProfiles({"dev", "it", "h2-mem"})
@DisplayName("체결 처리 테스트")
public class TradeQueueManagerTest {

Expand Down