Browse Source

Added Makefile and sonar-project.properties

tags/1.0.9
Johann Schmitz 3 years ago
parent
commit
a7073046e4
Signed by: ercpe <johann@j-schmitz.net> GPG Key ID: A084064277C501ED
2 changed files with 53 additions and 0 deletions
  1. +39
    -0
      Makefile
  2. +14
    -0
      sonar-project.properties

+ 39
- 0
Makefile View File

@@ -0,0 +1,39 @@
TARGET?=tests

test_default_python:
PYTHONPATH="." python -m pytest tests/ --junit-xml testresults.xml -rxsw -v

test_py2:
@echo Executing test with python2
PYTHONPATH="." python2 -m pytest tests/ --junit-xml testresults.xml -rxsw -v

#test_py3:
# @echo Executing test with python3
# PYTHONPATH="." python3 -m pytest tests/ --junit-xml testresults.xml -rxsw -v

test: test_py2 # test_py3

compile:
@echo Compiling python code
python -m compileall .

compile_optimized:
@echo Compiling python code optimized
python -O -m compileall .

coverage:
coverage erase
PYTHONPATH="." coverage run --source='fuglugelf' --branch -m py.test -qq tests/
coverage xml -i
coverage report -m

sonar:
/usr/local/bin/sonar-scanner/bin/sonar-scanner

clean:
find -name "*.py?" -delete
rm -f coverage.xml testresults.xml htmlcov dist *.egg-info
rm -rfv bin include lib lib64 pip-selfcheck.json

travis: compile compile_optimized test_default_python coverage
jenkins: travis sonar

+ 14
- 0
sonar-project.properties View File

@@ -0,0 +1,14 @@
# Required metadata
sonar.projectKey=ercpe:fuglu-gelf
sonar.projectName=fuglu-gelf
sonar.projectVersion=0.1

sonar.sources=fuglu_gelf
sonar.exclusions=**/tests/*.py
sonar.test.exclusions=**/tests/*.py
sonar.language=py

sonar.sourceEncoding=UTF-8

sonar.python.coverage.reportPath=coverage.xml
sonar.python.coverage.overallReportPath=coverage.xml

Loading…
Cancel
Save