Comments (5)
Could you please provide your build.py
?
from pybuilder.
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.
Well, I'm confused here. Does the coverage break without sonar cube? Because PyTest Coverage has nothing to do with SQ.
from pybuilder.
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.
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)
- Setuptools 62.2+ and twine require non-empty `long_description` HOT 16
- Python 3.11: remote process start fails in `_posixsubprocess.fork_exec` HOT 1
- The XML coverage report generated via PyBuilder can show wrong filenames and packages HOT 2
- pybuilder/terminal.py:135: ResourceWarning: unclosed file
- Python venv management needs to account for debug builds
- Should flake8 still be pinned?
- requests is not a dependency of pybuilder HOT 2
- distutils build_binary_distribution should run before "package" not "publish" HOT 2
- Problem in Windows OS HOT 3
- Module `imp` is not available in Python 3.12
- pybuilder does not run unit tests "correctly" - ModuleNotFoundError: No module named 'src' HOT 1
- pycharm: imports are unresolved but pyb works, also running the application works HOT 2
- support for netbeans or vscode HOT 4
- Specify Python version for virtual env HOT 4
- Newer versions of virtualenv causing clash with vendored virturalenv HOT 1
- Permission denied [Errno 13] when using source_distribution_plugin HOT 7
- Executing arbitrary shell command HOT 9
- SonarQube integration configuration HOT 10
- imports from pkg_resources are deprecated since setuptools==70 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pybuilder.