Skip to content

Commit

Permalink
[chore] : CI/CD 수정 (#157)
Browse files Browse the repository at this point in the history
* [test] : 시간 단축 위해 동시성 테스트 disabled 추가

* [chore] : gitignore에 firebase json 추가 및 파일명 변경 반영

* [chore] : firebase 파일 secret 추출 관련 코드 작성

* [style] : 코드 리포멧팅
  • Loading branch information
hyun2371 authored Apr 10, 2024
1 parent 02005bf commit 6acf9cd
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 59 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
run: |
mkdir -p ./core/src/main/resources/firebase
echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/main/resources/firebase/firebase_account.json
mkdir -p ./core/src/test/resources/firebase
echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/test/resources/firebase/firebase_account.json
# gradle 권한 부여
- name: Grant execute permission for gradlew
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/main/resources/firebase/firebase_account.json
mkdir -p ./core/src/test/resources/firebase
echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/test/resources/firebase/firebase_account.json
mkdir -p ./api/src/test/resources/firebase
echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./api/src/test/resources/firebase/firebase_account.json
# gradle 권한 부여
- name: Grant execute permission for gradlew
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ out/
.DS_Store
core/src/main/resources/application-core-dev.yml
core/src/main/resources/application-core-prod.yml
application-core.yml
/api/src/main/resources/application.yml
/core/src/main/generated/
/core/src/main/resources/firebase/firebase_account.json
/core/src/test/resources/firebase/firebase_account.json
/api/src/test/resources/firebase/firebase_account.json
4 changes: 0 additions & 4 deletions api/src/main/java/dev/handsup/HandsUpApplication.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package dev.handsup;

import java.util.TimeZone;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

import jakarta.annotation.PostConstruct;

@EnableJpaAuditing
@SpringBootApplication
public class HandsUpApplication {
Expand Down
15 changes: 8 additions & 7 deletions api/src/main/java/dev/handsup/common/domain/CacheType.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@

@Getter
public enum CacheType {

AUCTIONS(
"auctions", // 캐시 이름: users
10 * 60, // 만료 시간: 5 분
10000 // 최대 갯수: 10000
"auctions", // 캐시 이름: users
10 * 60, // 만료 시간: 5 분
10000 // 최대 갯수: 10000
);

private final String cacheName;
private final int expireAfterWrite;
private final int maximumSize;

CacheType(
String cacheName,
int expireSecondsAfterWrite,
Expand All @@ -19,8 +24,4 @@ public enum CacheType {
this.expireAfterWrite = expireSecondsAfterWrite;
this.maximumSize = maximumSize;
}

private final String cacheName;
private final int expireAfterWrite;
private final int maximumSize;
}
2 changes: 1 addition & 1 deletion api/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ cloud:
auto: false

fcm:
certification: firebase/firebase_service_account.json
certification: firebase/firebase_account.json
14 changes: 0 additions & 14 deletions api/src/test/resources/firebase/firebase_service_account.json

This file was deleted.

13 changes: 0 additions & 13 deletions core/src/main/resources/firebase/firebase_service_account.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -56,6 +57,7 @@ void setUp() {
user = userRepository.save(UserFixture.user1());
}

@Disabled
@DisplayName("[동시에 500개 요청 시, 입찰 금액이 모두 같다면 하나의 입찰만 저장된다.]")
@Test
void concurrency_test() throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.handsup.notification.domain.service;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.BDDMockito.*;

Expand All @@ -15,11 +14,9 @@
import com.google.firebase.messaging.FirebaseMessagingException;

import dev.handsup.auction.domain.Auction;
import dev.handsup.common.exception.NotFoundException;
import dev.handsup.fixture.AuctionFixture;
import dev.handsup.fixture.UserFixture;
import dev.handsup.notification.domain.NotificationType;
import dev.handsup.notification.exception.NotificationErrorCode;
import dev.handsup.notification.repository.FCMTokenRepository;
import dev.handsup.notification.service.FCMService;
import dev.handsup.notification.service.NotificationService;
Expand Down
14 changes: 0 additions & 14 deletions core/src/test/resources/firebase/firebase_service_account.json

This file was deleted.

0 comments on commit 6acf9cd

Please sign in to comment.