Skip to content

Commit

Permalink
Merge pull request #14 from Korea-Certified-Store/hotfix/fix-action-t…
Browse files Browse the repository at this point in the history
…est(#13)

fix : 오타 수정
  • Loading branch information
jinhoon227 authored Jan 4, 2024
2 parents 95caae0 + 17808dd commit caae0d7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/action-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- release*

pull_request:
branches:
- main
- develop
- release*
Expand All @@ -17,13 +18,15 @@ on:
# 참고사항
# push가 일어난 브랜치에 PR이 존재하면, push에 대한 이벤트와 PR에 대한 이벤트 모두 발생합니다.

# 단위 테스트 결과를 발행하기 위해 쓰기 권한을 주어야 합니다.
permissions: write-all

jobs:
test: # 테스트를 수행합니다.
runs-on: ubuntu-latest # 실행 환경 지정
steps:
- name: Checkout Repostiory
- uses: actions/checkout@v3 # github action 버전 지정(major version)
uses: actions/checkout@v3 # github action 버전 지정(major version)

- name: Set up JDK 17 # JAVA 버전 지정
uses: actions/setup-java@v3
Expand All @@ -50,7 +53,14 @@ jobs:

# 테스트 후 Result를 보기위해 Publish Unit Test Results step 추가
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ always() }} # 테스트가 실패하여도 Report를 보기 위해 `always`로 설정
with:
files: build/test-results/**/*.xml
files: build/test-results/test/TEST-*.xml

# 테스트 실패시 어디서 틀렸는지 알려줍니다.
- name: Add comments to a pull request
uses: mikepenz/action-junit-report@v3
if: ${{ always() }}
with:
report_paths: build/test-results/test/TEST-*.xml
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ dependencies {
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'

// 테스트 설정
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'com.h2database:h2'
}

tasks.named('test') {
Expand Down
18 changes: 18 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 테스트용 설정 - 인메모리 db 사용
spring:
datasource:
url: jdbc:h2:mem:test
username: sa
password:
driver-class-name: org.h2.Driver

jpa:
hibernate:
ddl-auto: create
properties:
hibernate:
format_sql: true

logging:
level:
org.hibernate.SQL: debug

0 comments on commit caae0d7

Please sign in to comment.