Code Monkey home page Code Monkey logo

Comments (5)

arcivanov avatar arcivanov commented on June 2, 2024

Could you please provide your build.py?

from pybuilder.

Famondir avatar Famondir commented on June 2, 2024

Sure. I tried it with this version using pytest:

#   -*- coding: utf-8 -*-
from pybuilder.core import use_plugin, init

use_plugin("python.core")
# use_plugin("python.unittest")
use_plugin('pypi:pybuilder_pytest')
use_plugin("python.flake8")
# use_plugin("python.coverage")
use_plugin('pypi:pybuilder_pytest_coverage')
use_plugin("python.distutils")
use_plugin("python.sonarqube")


name = "Music-Suite"
default_task = "publish"


@init
def set_properties(project):
    project.set_property("pytest_coverage_xml", True)
    project.get_property("pytest_extra_args").append("-x")
    project.set_property("pytest_coverage_break_build_threshold", 70)

    project.set_property("sonarqube_project_key", "musicsuitmusicsuite:2024e")
    # project.set_property("sonarqube_project_name", "Music Suite")

And using the default test suite like this:

#   -*- coding: utf-8 -*-
from pybuilder.core import use_plugin, init

use_plugin("python.core")
use_plugin("python.unittest")
# use_plugin('pypi:pybuilder_pytest')
use_plugin("python.flake8")
use_plugin("python.coverage")
# use_plugin('pypi:pybuilder_pytest_coverage')
use_plugin("python.distutils")
use_plugin("python.sonarqube")


name = "Music-Suite"
default_task = "publish"


@init
def set_properties(project):
    # project.set_property("pytest_coverage_xml", True)
    # project.get_property("pytest_extra_args").append("-x")
    # project.set_property("pytest_coverage_break_build_threshold", 70)

    project.set_property("sonarqube_project_key", "musicsuitmusicsuite:2024e")
    # project.set_property("sonarqube_project_name", "Music Suite")

from pybuilder.

arcivanov avatar arcivanov commented on June 2, 2024

Well, I'm confused here. Does the coverage break without sonar cube? Because PyTest Coverage has nothing to do with SQ.

from pybuilder.

Famondir avatar Famondir commented on June 2, 2024

When I run pyb instead of pyb run_sonar_analysis then the indication of not met thresholds is printed correctly in the terminal output.

And when I run the sonar scanner manually with sonar-scanner -Dsonar.projectKey=musicsuitmusicsuite:2024e -Dsonar.sources=. -Dsonar.host.url=http://localhost:9000 -Dsonar.token=sqp_xyz the not met threshold is violating the qualitygates correctly.

But when I run the sonar-scanner with PyBuilder it reports no quality gate issue. But I think I found the problem. After limiting the sonar-runner only on the src/main/python folder I got no issue there as well, because it only looked for new code and not the missing tests for the already existing code as it seems.

So when I added some more new code both ways report issues.

from pybuilder.

arcivanov avatar arcivanov commented on June 2, 2024

I'll keep this open as it might be a bug, but I'll need to create a repro case for it.

from pybuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.