2017-02-01 12 views
1

테스트 범위보고 및 단위 테스트 세부 정보 (테스트 사례 수, 통과 된 테스트 사례 수)를 소나에 입력하려고합니다. 내가 얻고 수중 음파 탐지기 주자를 실행하는 동안nosetests를 사용하는 단위 테스트 수는 파이썬 코드베이스의 소나 보고서에 반영되지 않습니다

내가 범위를 사용하여 보고서를 생성하고 nosetests가 플러그인 및 coverage.xml 및 nosetests.xml에 동일한 저장은

내 sonar.properties 파일

sonar.projectKey=python 
sonar.projectName=Python 
sonar.projectVersion=1.0 
sonar.sources=vmturbo 
sonar.tests=tests 
sonar.language=py 
sonar.sourceEncoding=UTF-8 
sonar.python.xunit.reportPath=nosetests.xml 
sonar.python.coverage.reportPath=coverage.xml 

처럼 보인다 아래 로그 메시지

0:29:51.022 INFO - Processing report '/Users/deepeshjain/Development/Python/CD/python-distribution/nosetests.xml' 
00:29:51.027 WARN - The resource for 'vmturbo_unit_tests.Test' is not found, drilling down to the details of this test won't be possible 
00:29:51.027 INFO - Sensor PythonXUnitSensor (done) | time=115ms 
00:29:51.027 INFO - Sensor SCM Sensor 
00:29:51.050 INFO - Sensor SCM Sensor (done) | time=23ms 
00:29:51.051 INFO - Sensor Python Squid Sensor 
00:29:51.221 INFO - Python unit test coverage 
00:29:51.223 INFO - Parsing report '/Users/deepeshjain/Development/Python/CD/python-distribution/coverage.xml' 
00:29:51.229 INFO - Python integration test coverage 
00:29:51.232 INFO - Python overall test coverage 
00:29:51.234 INFO - Sensor Python Squid Sensor (done) | time=183ms 

소나에 대한 테스트 커버리지 보고서를 얻을 수 있지만 동일한 단위 테스트 케이스 수를 얻을 수 없습니다.

+0

, 나는 nostests.xml –

답변

3

여러 옵션을 시도한 후 nosetests.xml에 테스트 케이스 경로 추가가 나에게 효과적이었습니다.

나오지 -i의/클래스 명 = "/ 클래스 명 ="tests./g '솔루션을 찾을 수

+0

에와 단위 테스트 폴더를 추가 할 필요가 nosetests.xml인가 거기 청소기 보고서 경로를 수정하는 것보다 어떻게해야합니까? – notanormie

+0

고마워, 그게 나를 위해 일했다. nosetests.xml을 편집하는 것보다이 작업을 수행하는 더 좋은 방법이 있어야합니다. 하지만 다시 한 번 감사드립니다! –