diff --git a/.circleci/config.yml b/.circleci/config.yml index 4679bb5..b34579e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,6 +27,8 @@ jobs: name: Install required packages. command: | sudo apt-get update + wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip + unzip sonar-scanner-cli-4.6.2.2472-linux.zip sudo pip install coverage coveralls pytest export PYTHONPATH=$PWD - run: @@ -34,6 +36,8 @@ jobs: command: | PYTHONPATH=$PWD python -m coverage run -m pytest */testcases/functional_testcases/*.py */testcases/unit_testcases/*.py python -m coverage report -m + coverage xml -i + sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.host.url=https://sonarqube.singularitynet.io -Dsonar.login=${SONAR_TOKEN} $SONAR_SCANNER_OPTS_CUSTOM - save_cache: key: dependency-cache-{{ checksum "/tmp/checksum_files_list" }} paths: diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..7ff0982 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=snet-notification-service +sonar.projectName=snet-notification-service +sonar.sources=. +sonar.tests=. +sonar.test.inclusions=**/testcases/*_testcases/test_*.py +sonar.go.exclusions=*.sh,*.md,.circleci/config.yml,LICENSE,**/requirements.txt,**/serverless.yml,**/package.json,node_modules/** +sonar.python.coverage.reportPaths=coverage.xml \ No newline at end of file