Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Test #8

Merged
merged 6 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading