Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

https://gerrit.onap.org/r/#/c/70581/1

(add your project Review here)

Python

Section TBDYour pom.xml file needs to specify several sonar properties. In particular, the <sonar.python.coverage.reportPaths> variable specifies the location of the coverage.xml file that is generated by tox. (Previous versions of sonar used the singular form of this variable; make certain that it has an "s" at the end of its name.)

Code Block
languagexml
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <sonar.sources>.</sonar.sources>
    <sonar.junit.reportsPath>xunit-results.xml</sonar.junit.reportsPath>
    <sonar.python.coverage.reportPaths>coverage.xml</sonar.python.coverage.reportPaths>
    <sonar.language>py</sonar.language>
    <sonar.pluginname>python</sonar.pluginname>
    <sonar.inclusions>**/**.py</sonar.inclusions>
    <sonar.exclusions>tests/*,setup.py</sonar.exclusions>
  </properties>

Your tox.ini file should list both py36 and py37. Because some of our build environments might be missing one of these python versions, you may also set the skip_missing_interpreters variable to true.

Code Block
languagetext
[tox]
envlist = py36,py37
skip_missing_interpreters = true

For Gradle

Section TDB