Skip to content

Commit

Permalink
CI Test (#8)
Browse files Browse the repository at this point in the history
* test: 실패하는 테스트 수정

* docs: ci 수정

* docs: ci 수정

* refactor: CI 수정

* refactor: CI 수정
  • Loading branch information
cookienc authored May 20, 2024
1 parent 1a5b20c commit cba7834
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 46 deletions.
59 changes: 29 additions & 30 deletions .github/workflows/pull-request-open.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name: Pull Request Open

on:
pull_request:
branches: [ "dev" ]

permissions: write-all

branches: ["dev"]
jobs:
build:
runs-on: ubuntu-22.04

permissions: write-all

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'

- name: Run tests
run: ./gradlew test

- name: Build with Gradle
run: ./gradlew build

- name: Publish Test Result
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'

- name: Comment Fail Test
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
token: ${{ github.token }}
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "corretto"

- name: Run tests
run: ./gradlew test

- name: Build with Gradle
run: ./gradlew build

- name: Publish Test Result
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: "**/build/test-results/test/TEST-*.xml"

- name: Comment Fail Test
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: "**/build/test-results/test/TEST-*.xml"
token: ${{ github.token }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,13 @@ import backend.itracker.crawl.macbook.domain.MacbookPrice
import backend.itracker.crawl.macbook.domain.MacbookRepository
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Assertions.assertAll
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import java.math.BigDecimal
import java.time.LocalDateTime

private val macbook = Macbook(
company = "Apple",
name = "Apple 2024 맥북 에어 13 M3, 미드나이트, M3 8코어, 10코어 GPU, 1TB, 16GB, 35W 듀얼, 한글",
type = "맥북 에어",
cpu = "M3 8코어",
gpu = "10코어 GPU",
storage = "1TB",
memory = "16GB",
language = "한글",
color = "미드나이트",
size = 13,
releaseYear = 2024,
productLink = "https://www.coupang.com/vp/products/7975088162?itemId=22505523317&vendorItemId=89547640201&sourceType=cmgoms&omsPageId=84871&omsPageUrl=84871",
thumbnail = "https://thumbnail10.coupangcdn.com/thumbnails/remote/230x230ex/image/retail/images/15943638430632-244768e7-86d1-4484-b772-013d185666b8.jpg",
isOutOfStock = false
)

@SpringBootTest
class MacbookServiceTest {
Expand All @@ -37,6 +22,28 @@ class MacbookServiceTest {
@Autowired
lateinit var macbookRepository: MacbookRepository

private lateinit var macbook: Macbook

@BeforeEach
fun setUp() {
macbook = Macbook(
company = "Apple",
name = "Apple 2024 맥북 에어 13 M3, 미드나이트, M3 8코어, 10코어 GPU, 1TB, 16GB, 35W 듀얼, 한글",
type = "맥북 에어",
cpu = "M3 8코어",
gpu = "10코어 GPU",
storage = "1TB",
memory = "16GB",
language = "한글",
color = "미드나이트",
size = 13,
releaseYear = 2024,
productLink = "https://www.coupang.com/vp/products/7975088162?itemId=22505523317&vendorItemId=89547640201&sourceType=cmgoms&omsPageId=84871&omsPageUrl=84871",
thumbnail = "https://thumbnail10.coupangcdn.com/thumbnails/remote/230x230ex/image/retail/images/15943638430632-244768e7-86d1-4484-b772-013d185666b8.jpg",
isOutOfStock = false
)
}

@Test
fun `전체 저장 테스트`() {
// given
Expand Down

0 comments on commit cba7834

Please sign in to comment.