Skip to content

Commit

Permalink
Integration Test 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
seungh0 committed Jul 6, 2024
1 parent 3dc4c8e commit efc5528
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/ci-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,25 @@ on:
workflow_dispatch:

jobs:
ci:
unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: checkout@v4
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: adopt
cache: gradle
timeout-minutes: 3

- name: Test
run: ./gradlew test

integration-test:
name: Build on Cassandra
runs-on: ubuntu-latest
strategy:
Expand All @@ -36,5 +54,5 @@ jobs:
run: docker compose -f "docker/docker-compose-cassandra-${{ matrix.cassandra-version }}.yml" up -d --build --wait
timeout-minutes: 3

- name: Build
run: ./gradlew build
- name: Test
run: ./gradlew integrationTest
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@ subprojects {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.register('integrationTest', Test) {
group = "verification"
useJUnitPlatform {
includeTags 'integration-test'
}
}

tasks.named('test') {
useJUnitPlatform()
useJUnitPlatform {
excludeTags 'integration-test'
}
testLogging {
showExceptions = true
exceptionFormat = 'FULL'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package kr.hakdang.cadio;

import com.datastax.oss.driver.api.core.CqlSession;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;

Expand All @@ -12,6 +13,7 @@
* @author seungh0
* @since 2024-07-01
*/
@Tag("integration-test")
@SpringBootTest(classes = {CoreRoot.class})
public abstract class IntegrationTest extends BaseTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package kr.hakdang.cadio.web;

import kr.hakdang.cadio.CoreRoot;
import org.junit.jupiter.api.Tag;
import org.springframework.boot.test.context.SpringBootTest;

/**
Expand All @@ -9,6 +10,7 @@
* @author seungh0
* @since 2024-07-01
*/
@Tag("integration-test")
@SpringBootTest(classes = {CoreRoot.class})
public abstract class IntegrationTest extends BaseTest {
}

0 comments on commit efc5528

Please sign in to comment.