sirin05137 / CSE364_Project

2 stars 0 forks source link

[Note] JaCoCo plugin w/ Junit #26

Closed yuujinleee closed 3 years ago

yuujinleee commented 3 years ago

귀염뽀짝한 🌟유진이🌟의 JaCoCo 관련 개인 노트 공간 🧸 💓

유진이가 junit 작성 중인 Branch 이름❓ yujin_junit

Currently solving ··· 😡

1. Skipping JaCoCo when mvn test

-> maven surefire plugin 이랑 함께 쓸 때 argline 등 처리해주어야 하는 문제같음

[INFO] --- jacoco-maven-plugin:0.8.2:prepare-agent (default-prepare-agent) @ cse364-project ---
[INFO] argLine set to -javaagent:/Users/yujinlee/.m2/repository/org/jacoco/org.jacoco.agent/0.8.2/org.jacoco.agent-0.8.2-runtime.jar=destfile=/Users/yujinlee/IdeaProjects/CSE364_Project/target/jacoco.exec
...
[INFO] --- jacoco-maven-plugin:0.8.2:report (jacoco-report) @ cse364-project ---
[INFO] Skipping JaCoCo execution due to missing execution data file.

-> Solved ✅ reference : https://stackoverflow.com/questions/23190107/cannot-use-jacoco-jvm-args-and-surefire-jvm-args-together-in-maven

2. Test Implementation && Code Coverage > 0.9 달성

현재 유진이가 열심히 작성중

Notes 📓

yuujinleee commented 3 years ago

Readme 에 추가해야 하는 내용 메모

  1. target 디렉토리 (generated when mvn install has excuted)아래에 jacoco-report 디렉토리 생성됌.
    • image

yuujinleee commented 3 years ago

@sirin05137 @sanghun17 너네는 이거만 보면 될 듯

JaCoCo 로 Branch coverage test 할 시

Junit 테스트는 이제 작성 중임.

yuujinleee commented 3 years ago

System Exit code testing (ExpectedSystemExit)

        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>1.19.0</version>
            <scope>test</scope>
        </dependency>

https://stefanbirkner.github.io/system-rules/#ExpectedSystemExit

image 킹받네.. . . ..

yuujinleee commented 3 years ago

https://mvnrepository.com/artifact/com.github.stefanbirkner/system-rules/1.19.0

yuujinleee commented 3 years ago

현재 Code Coverage 90%

image

cover 안된 부분

1. 조건문 부분 (system.exit 유지하고 테스트 처리)

image

2. 어제 새로 추가된 에러메시지 부분 (여긴 고치기 쉬움)

yuujinleee commented 3 years ago

최종 System Exit 처리

-> 이거로 함 https://todd.ginsberg.com/post/testing-system-exit/