Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 141 additions & 89 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jproperties = ">=2.1,<3"
[tool.poetry.group.dev]
[tool.poetry.group.dev.dependencies]
responses = "0.26.1"
pyfakefs = "5.10.2"
black = "25.12.0"
pyfakefs = "6.2.0"
black = "26.5.1"
coverage = "7.14.3"
licenseheaders = "0.8.8"
mypy = "1.20.2"
pytest = '8.4.2'
mypy = "2.1.0"
pytest = '9.1.1'
pytest-cov = '7.1.0'
pytest-subtests = "0.15.0"
pytest-docker = "3.2.5"
Expand Down
1 change: 0 additions & 1 deletion tests/its/test_auto_detect_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from tests.its.utils.sonarqube_client import SonarQubeClient
from tests.its.utils.cli_client import CliClient, SOURCES_FOLDER_PATH


pytestmark = pytest.mark.its


Expand Down
1 change: 0 additions & 1 deletion tests/its/test_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from tests.its.utils.sonarqube_client import SonarQubeClient
from tests.its.utils.cli_client import CliClient


# Marks this module
pytestmark = pytest.mark.its

Expand Down
1 change: 0 additions & 1 deletion tests/its/utils/cli_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from tests.its.utils.sonarqube_client import SonarQubeClient


SOURCES_FOLDER_PATH: pathlib.Path = pathlib.Path(__file__).resolve().parent / "../sources"
DEBUGPY_PORT: int = 5678

Expand Down
48 changes: 16 additions & 32 deletions tests/unit/test_configuration_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,12 @@ def test_load_sonar_project_properties(self, mock_get_os, mock_get_arch):

self.fs.create_file(
"sonar-project.properties",
contents=(
"""
contents=("""
sonar.projectKey=overwritten-project-key
sonar.projectName=My Project\n
sonar.sources=src # my sources\n
sonar.exclusions=**/generated/**/*,**/deprecated/**/*,**/testdata/**/*\n
"""
),
"""),
)
configuration = ConfigurationLoader.load()
expected_configuration = {
Expand Down Expand Up @@ -181,14 +179,12 @@ def test_load_sonar_project_properties_from_custom_path(self, mock_get_os, mock_
self.fs.create_dir("custom/path")
self.fs.create_file(
"custom/path/sonar-project.properties",
contents=(
"""
contents=("""
sonar.projectKey=custom-path-project-key
sonar.projectName=Custom Path Project
sonar.sources=src/main
sonar.tests=src/test
"""
),
"""),
)
configuration = ConfigurationLoader.load()
expected_configuration = {
Expand Down Expand Up @@ -230,15 +226,13 @@ def test_load_pyproject_toml_from_base_dir(self, mock_get_os, mock_get_arch):
self.fs.create_dir("custom/path")
self.fs.create_file(
"custom/path/pyproject.toml",
contents=(
"""
contents=("""
[tool.sonar]
projectKey = "custom-path-project-key"
project-name = "Custom Path Project"
sources = "src/main"
tests= "src/test"
"""
),
"""),
)
configuration = ConfigurationLoader.load()
expected_configuration = {
Expand Down Expand Up @@ -280,16 +274,14 @@ def test_load_pyproject_toml_from_toml_path(self, mock_get_os, mock_get_arch):
self.fs.create_dir("custom/path")
self.fs.create_file(
"custom/path/pyproject.toml",
contents=(
"""
contents=("""
[tool.sonar]
projectKey = "custom-path-project-key"
project-name = "Custom Path Project"
sources = "src/main"
tests= "src/test"
scanner.javaHeapSize = "8000Mb"
"""
),
"""),
)
configuration = ConfigurationLoader.load()
expected_configuration = {
Expand Down Expand Up @@ -333,16 +325,14 @@ def test_load_pyproject_toml_from_toml_path_with_file(self, mock_get_os, mock_ge
self.fs.create_dir("custom/path")
self.fs.create_file(
"custom/path/pyproject.toml",
contents=(
"""
contents=("""
[tool.sonar]
projectKey = "custom-path-project-key"
project-name = "Custom Path Project"
sources = "src/main"
tests= "src/test"
scanner.javaHeapSize = "8000Mb"
"""
),
"""),
)
configuration = ConfigurationLoader.load()
expected_configuration = {
Expand Down Expand Up @@ -380,15 +370,13 @@ def test_load_coveragerc_properties(self, mock_get_os, mock_get_arch):
self.fs.create_dir("custom/path")
self.fs.create_file(
".coveragerc",
contents=(
"""
contents=("""
[run]
omit =
*/.local/*
/usr/*
utils/tirefire.py
"""
),
"""),
)
configuration = ConfigurationLoader.load()
expected_configuration = {
Expand Down Expand Up @@ -616,22 +604,19 @@ def test_properties_priority(self, mock_get_os, mock_get_arch):
# Create both configuration files
self.fs.create_file(
"sonar-project.properties",
contents=(
"""
contents=("""
sonar.projectKey=ProjectKeyFromProperties
sonar.projectName=Properties Project
sonar.projectDescription=Properties Project Description
sonar.sources=src/properties
sonar.tests=test/properties
sonar.exclusions=properties-exclusions/**/*
sonar.userHome=/properties/sonar/home
"""
),
"""),
)
self.fs.create_file(
"pyproject.toml",
contents=(
"""
contents=("""
[project]
name = "My Overridden Project Name"
description = "My Project Description"
Expand All @@ -642,8 +627,7 @@ def test_properties_priority(self, mock_get_os, mock_get_arch):
sources = "src/toml"
exclusions = "toml-exclusions/**/*"
userHome = "/toml/sonar/home"
"""
),
"""),
)

configuration = ConfigurationLoader.load()
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/test_pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,15 @@ def test_load_toml_file_from_direct_file_path_missing(self):
def test_load_toml_file_project_content(self):
self.fs.create_file(
"pyproject.toml",
contents=(
"""
contents=("""
[project]
name = "My Overridden Project Name"
description = "My Project Description"
requires-python = ["3.6", "3.7", "3.8"]
[tool.sonar]
project-key = "my-project"
project-name = "My Project"
"""
),
"""),
)
properties = TomlConfigurationLoader.load(Path("."))

Expand Down
Loading