-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run all tests at once to get better coverage overview (#2303)
* Run all tests at once to get better coverage overview * test resources: skip if running on env without docker * lower coverage minimum to 45
- Loading branch information
Showing
3 changed files
with
46 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
[tool.pytest.ini_options] | ||
markers = [ | ||
"incremental: Mark tests as incremental", | ||
"kubevirt: Mark tests as kubevirt tests" | ||
"kubevirt: Mark tests as kubevirt tests", | ||
] | ||
addopts = [ | ||
"--pdbcls=IPython.terminal.debugger:TerminalPdb", | ||
"--cov-config=pyproject.toml", | ||
"--cov-report=html", | ||
"--cov-report=term", | ||
"--cov=ocp_resources" | ||
"--cov=ocp_resources.resource", | ||
"--cov=ocp_resources.utils.resource_constants", | ||
"--cov=ocp_resources.utils.constants", | ||
"--cov=ocp_resources.utils.utils", | ||
"--cov=ocp_resources.exceptions", | ||
"--cov=class_generator", | ||
] | ||
|
||
[tool.coverage.run] | ||
omit = [ "tests/*" ] | ||
omit = ["tests/*", "class_generator/tests/*", "class_generator/scripts/tests/*"] | ||
|
||
[tool.coverage.report] | ||
fail_under = 45 | ||
skip_empty = true | ||
|
||
[tool.coverage.html] | ||
|
@@ -26,19 +32,19 @@ line-length = 120 | |
fix = true | ||
output-format = "grouped" | ||
|
||
[tool.ruff.format] | ||
exclude = [ ".git", ".venv", ".mypy_cache", ".tox", "__pycache__" ] | ||
[tool.ruff.format] | ||
exclude = [".git", ".venv", ".mypy_cache", ".tox", "__pycache__"] | ||
|
||
[tool.mypy] | ||
no_implicit_optional = true | ||
show_error_codes = true | ||
warn_unused_ignores = true | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = [ "ocp_resources", "class_generator" ] | ||
packages = ["ocp_resources", "class_generator"] | ||
|
||
[tool.uv] | ||
dev-dependencies = [ "ipdb>=0.13.13", "ipython>=8.12.3" ] | ||
dev-dependencies = ["ipdb>=0.13.13", "ipython>=8.12.3"] | ||
|
||
[project] | ||
requires-python = ">=3.9" | ||
|
@@ -47,10 +53,10 @@ version = "11.0.24" | |
description = "Wrapper around https://github.com/kubernetes-client/python" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
keywords = [ "Openshift", "Kubevirt", "Openshift Virtualization" ] | ||
keywords = ["Openshift", "Kubevirt", "Openshift Virtualization"] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent" | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = [ | ||
"click>=8.1.7", | ||
|
@@ -70,34 +76,34 @@ dependencies = [ | |
"ruff>=0.6.9", | ||
"testcontainers>=4.9.0", | ||
"timeout-sampler>=0.0.46", | ||
"xmltodict>=0.13.0" | ||
"xmltodict>=0.13.0", | ||
] | ||
|
||
[[project.authors]] | ||
name = "Meni Yakove" | ||
email = "[email protected]" | ||
[[project.authors]] | ||
name = "Meni Yakove" | ||
email = "[email protected]" | ||
|
||
[[project.authors]] | ||
name = "Ruth Netser" | ||
email = "[email protected]" | ||
[[project.authors]] | ||
name = "Ruth Netser" | ||
email = "[email protected]" | ||
|
||
[[project.maintainers]] | ||
name = "Meni Yakove" | ||
email = "[email protected]" | ||
[[project.maintainers]] | ||
name = "Meni Yakove" | ||
email = "[email protected]" | ||
|
||
[[project.maintainers]] | ||
name = "Ruth Netser" | ||
email = "[email protected]" | ||
[[project.maintainers]] | ||
name = "Ruth Netser" | ||
email = "[email protected]" | ||
|
||
[project.urls] | ||
homepage = "https://github.com/RedHatQE/openshift-python-wrapper" | ||
documentation = "https://openshift-python-wrapper.readthedocs.io/en/latest/" | ||
Download = "https://pypi.org/project/openshift-python-wrapper/" | ||
"Bug Tracker" = "https://github.com/RedHatQE/openshift-python-wrapper/issues" | ||
[project.urls] | ||
homepage = "https://github.com/RedHatQE/openshift-python-wrapper" | ||
documentation = "https://openshift-python-wrapper.readthedocs.io/en/latest/" | ||
Download = "https://pypi.org/project/openshift-python-wrapper/" | ||
"Bug Tracker" = "https://github.com/RedHatQE/openshift-python-wrapper/issues" | ||
|
||
[project.scripts] | ||
class-generator = "class_generator.class_generator:main" | ||
[project.scripts] | ||
class-generator = "class_generator.class_generator:main" | ||
|
||
[build-system] | ||
requires = [ "hatchling" ] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,7 @@ | ||
skipsdist = true | ||
env_list = [ | ||
"validate-resources", | ||
"validate-resources-script", | ||
"class-generator", | ||
"resource-tests", | ||
"api-group-order", | ||
"validate-unittests", | ||
] | ||
|
||
[env.resource-tests] | ||
description = "Run resource tests on local cluster (k3d)" | ||
passenv = ["KUBECONFIG"] | ||
deps = ["uv"] | ||
commands = [["uv", "run", "pytest", "tests/test_resources.py"]] | ||
|
||
[env.validate-resources] | ||
description = "Run validation resources tests" | ||
deps = ["uv"] | ||
commands = [["uv", "run", "pytest", "tests/test_validate_resources.py"]] | ||
|
||
[env.validate-resources-script] | ||
description = "Run validation resources script tests (test the script itself, not the resources)" | ||
deps = ["uv"] | ||
commands = [["uv", "run", "pytest", "tests/test_validate_resources_script.py"]] | ||
|
||
[env.class-generator] | ||
description = "Run class generator tests" | ||
deps = ["uv"] | ||
commands = [["uv", "run", "pytest", "class_generator/"]] | ||
|
||
[env.api-group-order] | ||
description = "Run API group order tests" | ||
deps = ["uv"] | ||
commands = [["uv", "run", "pytest", "tests/test_api_group_order.py"]] | ||
env_list = ["unittests"] | ||
|
||
[env.unittests] | ||
description = "Run unittests" | ||
deps = ["uv"] | ||
commands = [["uv", "run", "pytest", "tests/test_unittests.py", "-svv"]] | ||
commands = [["uv", "run", "pytest"]] |