13. 할 짓 요약
Jenkins 설치
소스 보관소 연동
코드가 좋은 코드인지 확인
코드가 잘 돌아가는 건지 확인
코드량이 얼마인지 확인
14. Jenkins 설치
소스 보관소 연동 Github
JSLint
코드가 좋은 코드인지 확인
JSLint 결과 Jenkins에서 시각화
Testing framework : Qunit
테스트 자동화 : JsTestDriver
코드가 잘 돌아가는 건지 확인
코드 커버리지: jscoverage
Test결과(jUnit test result Plugin)
테스트 결과를 jenkins에서 시각
화
Coverage 결과(cobertura Plugin)
코드량이 얼마인지 확인 N’Siq Plugin
31. JSLint 연동
5. Jenkins 그래프로 보기 – violations plugin 설치
6. Jenkins 그래프로 보기 – project 설정
32. JSLint 연동
7. Jenkins 그래프로 보기 – 빌드 그리고 확인(1)
70개의 문제가 발견 됨을 표시하고 있음
33. JSLint 연동
7. Jenkins 그래프로 보기 – 빌드 그리고 확인(2)
파일별로 오류 내용을 확인 할 수 있음
34. JsTestDriver 연동
연동 방법 개요
1. JsTestDriver.jar , JsTestDriver-Qunit adaptor, jscoverage 다운로드
2. JsTestDriver.conf 설정
3. Ant 빌드 스크립트 작성
4. JsTestDriver Running
5. 테스트 결과를 그래프로 보기 위한 설정(jUnit test result report)
6. 커버리지 결과를 그래프로 보기 위한 설정(cobertura Plugin설치)
7. Cobertura Plugin에서 지원되는 xml타입으로 coverage결과를 변환
40. JsTestDriver 연동
6. Build !
테스트 결과 : TEST-Chrome_210118083_Windows.DefaultaModule.xml
테스트 커버리지 : jsTestDriver.conf-coverage.dat
41. JsTestDriver 연동
7. 테스트 결과를 그래프로 보기 위한 projcet 설정(jUnit test result report)
동작 방식 : ‘TEST-Chrome_210118083_Windows.DefaultaModule.xml’ 파일을 분석해서 결과를 보여줌.
43. JsTestDriver 연동
8. 커버리지 결과를 그래프로 보기 위한 설정(cobertura Plugin설치)
9. Cobertura Plugin에서 지원되는 xml타입으로 coverage결과를 변환
jsTestDriver.conf-coverage.dat 파일을 Cobertura지원 xml 타입으로 변환하기 위해 python 오픈소스 script를 활용
• 먼저 Local 에 Python 설치: http://www.python.org/getit/
• Cobertura 변환 Python script 다운로드 : https://github.com/eriwen/lcov-to-cobertura-xml
• 실행 : Jenkins Python Plugin을 통해서 script를 실행 할 수 있지만, 윈도우에서 Python 실행 PATH를 인식하지 못하는
문제 발견. 대안으로 Ant build로 실행하고 exeutable에 절대경로를 입력
<다음장에서 Ant build 설정>
44. JsTestDriver 연동
9. Cobertura Plugin에서 지원되는 xml타입으로 coverage결과를 변환
Ant build에 python script 실행 추가
<target name="start" depends="jstestdriver" description="build python script">
<echo>build python for making cobertura xml</echo>
<exec executable="C:Python27python.exe" failonerror="true">
<arg value="lib_etc/lcov-to-cobertura-xml.py" />
<arg value="build/jsTestDriver.conf-coverage.dat" />
<arg value="-o"/>
<arg value="build/coverage.xml"/>
</exec>
</target>
51. 좀 더 해야 할 것
Jstestdriver
test code에서 외부 라이브러리를 사용하는 경우 에러가 발생. Js파일을 로딩하는데 문제가 있음 (require.js와
같은 것으로 동적로딩 필요)
복잡도, 중복코드 검사
Cyclomatic complexity 나 중복코드 검사 Plugin 연동 Reporting
Other Testing
Selenium, WebDriver, or PhantomJS
Mobile 환경 테스트
Other CI (Travis CI)
Github 와 찰떡 궁합으로 경량화된 CI
http://blog.outsider.ne.kr/779
http://tech.qmetric.co.uk/automating-javascript-ci-with-buster-js-and-travisci_205.html
52. Appendix. Inside NHN 품질관리
Hudson 기반의 Quality Practice 활동
http://book.naver.com/bookdb/book_detail.nhn?bid=6349938 (book)
JSLint Cyclomatic Complexity, Coverage 통합 자체 Plugin 개발
Selenium 활용한 UI Test 자동
http://helloworld.naver.com/helloworld/87523
http://www.slideshare.net/jscamp_kr/jscamp-hannam-qunit-test-automation-using-hudson-and-selenium
Dashboard, JIRA 연동
중복코드 검사
기타 프로젝트별 Build에 필요한 Hudson Plugin개발