Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Repository

This is a simple Python project with some test cases. I connected it to SonarQube to get me the code coverage of the repository. So far it's only telling me python files code coverage

Prereq

You need to install sonarQube thing from the video in the beginning. Also need Docker

How to run

To run the main program:

I followed this video mainly to get SonarQube active (https://youtu.be/6vdRvz_LnbQ) First I made sure docker was running then ran the commands, docker pull sonarqube and docker run -d --name sonarqube-db -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -e POSTGRES_DB=sonarqube postgres:alpine Also the command docker run -d --name sonarqube -p 9000:9000 --link sonarqube-db:db -e SONAR_JDBC_URL=jdbc:postgresql://db:5432/sonarqube -e SONAR_JDBC_USERNAME=sonar -e SONAR_JDBC_PASSWORD=sonar sonarqube

Then I ran pytest --cov=. --cov-report=xml to get an xml report of the python test cases. I am not sure why I had to do this. I thought SonarQube would be able to do it for me.

Also in sonar-scanner.properties I added in an exclusion line to exclude test_main.py from it

Next I ran /Users/eleanorfoley/Documents/WPI/MQP/sonar-scanner-6.2.1.4610-macosx-aarch64/bin/sonar-scanner \ -Dsonar.projectKey=week1test \ -Dsonar.sources=. \ -Dsonar.host.url=http://localhost:9000 \ -Dsonar.token=sqp_847fbaa192f7c87a62d5afe7df0b74832385f7dd

This was the last step

Afterwards can go in docker and run them

#Seperate Interesting command is pytest --cov=. --cov-report=term-missing

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages