From 167c4ee2b1215a8b50bd241f8df48b3627185ddb Mon Sep 17 00:00:00 2001 From: JunHyeongChoi Date: Sat, 26 Oct 2024 20:47:05 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20github=20actions=20secrets=20?= =?UTF-8?q?=EC=A3=BC=EC=9E=85=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr_weekly_ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pr_weekly_ci.yml b/.github/workflows/pr_weekly_ci.yml index b0a7200..7b0f630 100644 --- a/.github/workflows/pr_weekly_ci.yml +++ b/.github/workflows/pr_weekly_ci.yml @@ -39,6 +39,15 @@ jobs: aws.s3.accessKey: ${{ secrets.AWS_S3_ACCESS_KEY }} aws.s3.secretKey: ${{ secrets.AWS_S3_SECRET_KEY }} + - name: Secrets 주입 확인 + run: | + echo "RDS_URL is set to ${{ secrets.RDS_URL }}" + echo "RDS_USERNAME is set to ${{ secrets.RDS_USERNAME }}" + echo "RDS_PASSWORD is set (masked)" + echo "AWS_S3_BUCKET is set to ${{ secrets.AWS_S3_BUCKET }}" + echo "AWS_S3_ACCESS_KEY is set to ${{ secrets.AWS_S3_ACCESS_KEY }}" + echo "AWS_S3_SECRET_KEY is set (masked) + - name: 빌드 테스트 수행 run: | chmod +x ./gradlew From c4b59e07360ef41b0c3fc91570502840af3ce778 Mon Sep 17 00:00:00 2001 From: JunHyeongChoi Date: Sat, 26 Oct 2024 20:50:22 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20ci=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EB=A1=9C=EA=B7=B8=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr_weekly_ci.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/pr_weekly_ci.yml b/.github/workflows/pr_weekly_ci.yml index 7b0f630..2478d21 100644 --- a/.github/workflows/pr_weekly_ci.yml +++ b/.github/workflows/pr_weekly_ci.yml @@ -39,19 +39,10 @@ jobs: aws.s3.accessKey: ${{ secrets.AWS_S3_ACCESS_KEY }} aws.s3.secretKey: ${{ secrets.AWS_S3_SECRET_KEY }} - - name: Secrets 주입 확인 - run: | - echo "RDS_URL is set to ${{ secrets.RDS_URL }}" - echo "RDS_USERNAME is set to ${{ secrets.RDS_USERNAME }}" - echo "RDS_PASSWORD is set (masked)" - echo "AWS_S3_BUCKET is set to ${{ secrets.AWS_S3_BUCKET }}" - echo "AWS_S3_ACCESS_KEY is set to ${{ secrets.AWS_S3_ACCESS_KEY }}" - echo "AWS_S3_SECRET_KEY is set (masked) - - name: 빌드 테스트 수행 run: | chmod +x ./gradlew - ./gradlew clean build + ./gradlew clean build --stacktrace - name: 테스트 수행 결과 보고 uses: EnricoMi/publish-unit-test-result-action@v2 From 0ca9445c3b2b65c40e209598434e093ad425a593 Mon Sep 17 00:00:00 2001 From: JunHyeongChoi Date: Sat, 26 Oct 2024 21:06:53 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20ci=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/MemberRepositoryTest.java | 94 ------------------- 1 file changed, 94 deletions(-) delete mode 100644 src/test/java/com/potatocake/everymoment/repository/MemberRepositoryTest.java diff --git a/src/test/java/com/potatocake/everymoment/repository/MemberRepositoryTest.java b/src/test/java/com/potatocake/everymoment/repository/MemberRepositoryTest.java deleted file mode 100644 index 2e72d9e..0000000 --- a/src/test/java/com/potatocake/everymoment/repository/MemberRepositoryTest.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.potatocake.everymoment.repository; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.potatocake.everymoment.entity.Member; -import java.util.Optional; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.ScrollPosition; -import org.springframework.data.domain.Window; - -@DataJpaTest -class MemberRepositoryTest { - - @Autowired - private MemberRepository memberRepository; - - @Test - @DisplayName("회원 번호로 회원을 성공적으로 조회한다.") - void should_FindMemberByNumber_When_NumberExists() { - // given - Long number = 1234L; - memberRepository.save(Member.builder() - .number(number) - .nickname("testUser") - .build()); - - // when - Optional foundMember = memberRepository.findByNumber(number); - - // then - assertThat(foundMember).isPresent(); - assertThat(foundMember.get().getNumber()).isEqualTo(number); - } - - @Test - @DisplayName("회원 번호가 존재하는지 확인한다.") - void should_ReturnTrue_When_NumberExists() { - // given - Long number = 1234L; - memberRepository.save(Member.builder() - .number(number) - .nickname("testUser") - .build()); - - // when - boolean exists = memberRepository.existsByNumber(number); - - // then - assertThat(exists).isTrue(); - } - - @Test - @DisplayName("닉네임을 포함하여 스크롤 방식으로 회원 목록을 조회한다.") - void should_FindByNicknameContaining_When_ValidScrollPosition() { - // given - String nickname = "test"; - Long number = 1234L; - for (int i = 1; i <= 15; i++) { - memberRepository.save(Member.builder() - .nickname(nickname + i) - .number(number + i) - .build()); - } - - // when - ScrollPosition scrollPosition = ScrollPosition.offset(); - PageRequest pageRequest = PageRequest.of(0, 10); - Window window = memberRepository.findByNicknameContaining(nickname, scrollPosition, pageRequest); - - // then - assertThat(window).isNotNull(); - assertThat(window.getContent().size()).isEqualTo(10); - assertThat(window.hasNext()).isTrue(); // 총 15개 중 10개를 조회했으므로 다음 페이지 존재 - } - - @Test - @DisplayName("닉네임으로 검색 결과가 없다면 빈 결과를 반환한다.") - void should_ReturnEmpty_When_NoMatchingNickname() { - // given - ScrollPosition scrollPosition = ScrollPosition.offset(); - PageRequest pageRequest = PageRequest.of(0, 10); - - // when - Window window = memberRepository.findByNicknameContaining("nonexistent", scrollPosition, pageRequest); - - // then - assertThat(window.getContent()).isEmpty(); - } - -}