-
Notifications
You must be signed in to change notification settings - Fork 8
chore: ci 스크립트 작성 및 ci 통과를 위한 코드 수정 #266
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
Merged
nayonsoso
merged 12 commits into
solid-connection:develop
from
nayonsoso:chore/111-implement-ci-and-fix-test
Apr 2, 2025
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9d2499e
chore: ci 스크립트 작성
nayonsoso 4a4beef
chore: 테스트용 application.yml 분리
nayonsoso 258afc3
test: test profile 제거
nayonsoso 88d3d18
refactor: 애플 시크릿키를 yml로 이동
nayonsoso bf221bb
refactor: 함수 이름 변경
nayonsoso ce48dd5
refactor: 오타 수정
nayonsoso bac8b4e
refactor: redis testcontainers 설정 수정
nayonsoso 5009561
refactor: ddl-auto 옵션 변경
nayonsoso 2bc5313
test: e2e 테스트 수정
nayonsoso ca3b367
chore: createAt과 updateAt의 나노초 길이 고정
nayonsoso 3d203e8
style: 주석 추가
nayonsoso c364691
refactor: MySQL 테스트 컨테이너 설정 변경
nayonsoso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: CI with Gradle | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "develop", "release", "master" ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| checks: write | ||
|
|
||
| steps: | ||
| - name: Checkout the code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
|
|
||
| - name: Make Gradle wrapper executable | ||
| run: chmod +x ./gradlew | ||
|
|
||
| - name: Build with Gradle Wrapper | ||
| run: ./gradlew build | ||
|
|
||
| - name: Publish Test Report | ||
| uses: mikepenz/action-junit-report@v5 | ||
| if: success() || failure() | ||
| with: | ||
| report_paths: '**/build/test-results/test/TEST-*.xml' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 15 additions & 18 deletions
33
src/test/java/com/example/solidconnection/support/RedisTestContainer.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,25 @@ | ||
| package com.example.solidconnection.support; | ||
|
|
||
| import jakarta.annotation.PostConstruct; | ||
| import org.springframework.boot.test.context.TestConfiguration; | ||
| import org.springframework.test.context.DynamicPropertyRegistry; | ||
| import org.springframework.test.context.DynamicPropertySource; | ||
| import org.springframework.boot.test.util.TestPropertyValues; | ||
| import org.springframework.context.ApplicationContextInitializer; | ||
| import org.springframework.context.ConfigurableApplicationContext; | ||
| import org.testcontainers.containers.GenericContainer; | ||
| import org.testcontainers.junit.jupiter.Container; | ||
|
|
||
| @TestConfiguration | ||
| public class RedisTestContainer { | ||
| public class RedisTestContainer implements ApplicationContextInitializer<ConfigurableApplicationContext> { | ||
|
|
||
| @Container | ||
| private static final GenericContainer<?> CONTAINER = new GenericContainer<>("redis:7.0"); | ||
| private static final int ORIGINAL_PORT = 6379; | ||
| private static final GenericContainer<?> CONTAINER = new GenericContainer<>("redis:7.0") | ||
| .withExposedPorts(ORIGINAL_PORT); | ||
|
|
||
| @DynamicPropertySource | ||
| static void redisProperties(DynamicPropertyRegistry registry) { | ||
| registry.add("spring.redis.host", CONTAINER::getHost); | ||
| registry.add("spring.redis.port", CONTAINER::getFirstMappedPort); | ||
| static { | ||
| CONTAINER.start(); | ||
| } | ||
|
|
||
| @PostConstruct | ||
| void startContainer() { | ||
| if (!CONTAINER.isRunning()) { | ||
| CONTAINER.start(); | ||
| } | ||
| @Override | ||
| public void initialize(ConfigurableApplicationContext applicationContext) { | ||
| TestPropertyValues.of( | ||
| "spring.data.redis.host=" + CONTAINER.getHost(), | ||
| "spring.data.redis.port=" + CONTAINER.getMappedPort(ORIGINAL_PORT) | ||
| ).applyTo(applicationContext.getEnvironment()); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 변경하면서 redis와 mysql testcontainers 구현 방식이 달라졌는데 통일하는 건 어떨까요?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳이 다르게 설정할 필요는 없겠네요.
반영했습니다! 🫡
c364691