dropthecode's People
Forkers
srini-nathandropthecode's Issues
Heroku에 SonarQube App을 생성하여 정적 코드 분석하기
`gradle build`일 때만 API 문서화를 하여 로컬에서 테스트 속도 향상
지금은 테스트를 실행할 때마다 Spring Auto REST Docs로 문서화를 하도록 설정되어 있다.
public static MockMvc restDocsMockMvc(RestDocumentationContextProvider provider, Snippet[] snippets, Object... controllers) {
return MockMvcBuilders.standaloneSetup(controllers)
...
// javadoc을 json 형식으로 생성
.alwaysDo(prepareJackson(OBJECT_MAPPER))
// javadoc을 바탕으로 api 문서화
.alwaysDo(restDocumentation())
...
}
로컬에서 테스트를 실행할 때 문서화를 하지 않고, 빌드할 때만 문서화를 한다면 로컬에서의 테스트 속도를 향상시킬 수 있다.
이는 느린 테스트 실행 속도로 인한 테스트에 대한 거부감을 낮추어 테스트 작성을 더 활발히 할 수 있게 한다.
로컬에서 문서화가 필요하다면 test
가 아닌 gradle
로 실행한다.
그래서 task
가 test
일 경우에는 문서화를 하지 않는 mockMvc
를 사용하고, gradle
일 경우에는 문서화를 하는 restDockMvc
를 사용하도록 한다.
Heroku로 Redis 사용하기
SonarQube와 Jenkins를 연동하여 자동으로 정적 코드 분석
소나큐브 도입 이유
코드 품질 관리를 위해 도입했다.
Jenkins와 연동
로컬에서 프로젝트의 코드 커버리지 혹은 코드 스멜을 확인하기 위해 일일이 소나 큐브를 실행시키는 것은 귀찮다.
리모트 저장소에 코드를 push하면, 소나 큐브 웹 서버에서 코드를 검사하여 결과를 출력하도록 한다.
Test에서 RestAssured, MockMvc Log 제거
RestAssured.log.all() 및 mockMvc.print()로 요청 및 응답에 대한 로깅을 하던 것을 제거했다.
그 이유는 다음과 같다.
- 테스트의 속도를 느리게 한다. 테스트의 개수가 많아질수록 출력해야 하는 로그의 수가 늘어 테스트를 느리게 한다.
- 중요한 로그를 보지 못하게 한다. 로그가 너무 많아서 정작 봐야할 로그를 못보게 한다.
개발할 때 말고는 보지 않는 로그이니 지우는 게 좋다고 생각한다.
필요할 때 로그 메소드를 추가하는 것이 좋겠다.
Heroku로 프론트 서버 배포하기
Heroku에 Jenkins App을 생성하여 CI&CD 적용하기
SonarCloud를 이용하여 PR에 SonarQube 결과 표시하기
깃 레포지토리에서 QEntity 제거
Heroku로 스프링 어플리케이션 배포하기
Heroku에 MySQL App 생성하여 데이터 관리하기
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.