Skip to content

dsrinivas605/sonarqube_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sonarqube-python

Pre-Requisites:

- Install python, pip
- Install nose, coverage, nosexcover, pylint
- SonarQube Setup
- Install Sonar-Scanar

Install python and pip

yum install python-pip

Insrall nose, coverage, nosexcover, pylint

pip install nose coverage nosexcover pylint

Sonarqube installation

Sonarqube installaton

Clone code into local

git clone https://github.com/sduggi/sonarqube-python.git
cd sonarqube-python

Run command to get "nosetests.xml" & "coverage.xml"

Once installed, you need to execute nosetests to run your unit tests, and generate information relating to the source code. The following line runs the test runner, generates coverage information, and generates an XML test report that SonarScanner will use:

nosetests -sv --with-xunit --xunit-file=nosetests.xml --with-xcoverage --xcoverage-file=coverage.xml

image

Install Sonar-Scanar

cd /opt
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip
unzip sonar-scanner-cli-4.4.0.2170-linux.zip
mv sonarqube-python/sonar-scanner.properties /opt/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties

Run Sonar-Scanar to test python application with SonarQube

cd /opt/sonar-scanner-cli-4.4.0.2170-linux/bin
./sonar-scanner

image

Check test result in Sonarqube UI

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages