Skip to content

Commit ff567ca

Browse files
committed
move more tests to the plugins consistency tests
Change-Id: Ib345e5dacada720dfcdb2bdd8f0a14bd2cb21160
1 parent eb1cff0 commit ff567ca

3 files changed

Lines changed: 55 additions & 15 deletions

File tree

tests/unit/cmk/gui/dashboard/test_builtin_dashboards_integrity.py renamed to tests/integration/cmk/plugins_consistency/test_builtin_dashboards_integrity.py

File renamed without changes.

tests/unit/cmk/gui/graphing/test_from_api.py renamed to tests/integration/cmk/plugins_consistency/test_graphing_plugins.py

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from cmk.graphing.v1 import translations as translations_api
2121
from cmk.gui.graphing_main import _load_graphing_plugins
2222
from cmk.utils.paths import omd_root
23+
from tests.testlib.common.repo import is_non_free_repo
2324

2425

2526
def test_load_graphing_plugins() -> None:
@@ -288,6 +289,7 @@ def _metric_names_by_module(
288289
return metric_names_by_module
289290

290291

292+
@pytest.mark.skip_if_edition("community")
291293
def test_bundles() -> None:
292294
offenders = [
293295
(module, metric_names)
@@ -326,14 +328,14 @@ def test_bundles() -> None:
326328

327329

328330
_ALLOWED_BUNDLE_VIOLATIONS = (
329-
set()
330-
if edition(omd_root) is Edition.COMMUNITY
331-
else {
331+
{
332332
# we cannot have sub-modules below the cee folder, so we have to allow the following violations
333333
# in cmk.nonfree.pro.robotmk, the module layout of the metric etc. defintions is correct
334334
"cmk.plugins.robotmk.graphing.nonfree",
335335
"cmk.plugins.azure_v2.graphing.nonfree.ultimate",
336336
}
337+
if is_non_free_repo()
338+
else set()
337339
)
338340

339341

@@ -467,6 +469,41 @@ def test_bundles() -> None:
467469
"Utilization": {"cisco_sma_queue_utilization", "generic_util"},
468470
"Write latency": {"write_latency", "db_write_latency_s"},
469471
"Write operations": {"write_ops_s", "disk_write_ios"},
472+
"Failed requests (404)": {
473+
"azure_cosmosdb_database_failed_requests",
474+
"azure_cosmosdb_database_container_failed_requests",
475+
"azure_cosmosdb_failed_requests",
476+
},
477+
"Throttled requests ratio": {
478+
"azure_cosmosdb_throttled_ratio",
479+
"azure_cosmosdb_database_throttled_ratio",
480+
"azure_cosmosdb_database_container_throttled_ratio",
481+
},
482+
"Throttled requests (429)": {
483+
"azure_cosmosdb_database_container_throttled_requests",
484+
"azure_cosmosdb_database_throttled_requests",
485+
"azure_cosmosdb_throttled_requests",
486+
},
487+
"Total requests": {
488+
"azure_cosmosdb_database_container_total_requests",
489+
"azure_cosmosdb_database_total_requests",
490+
"azure_cosmosdb_totalrequests",
491+
},
492+
"Normalized RU consumption": {
493+
"azure_cosmosdb_normalized_ru_consumption",
494+
"azure_cosmosdb_database_normalized_ru_consumption",
495+
"azure_cosmosdb_database_container_normalized_ru_consumption",
496+
},
497+
"Total RUs": {
498+
"azure_cosmosdb_database_total_rus",
499+
"azure_cosmosdb_total_rus",
500+
"azure_cosmosdb_database_container_total_rus",
501+
},
502+
"Data usage": {"data_usage", "azure_cosmosdb_data_usage"},
503+
"Cache hits": {"azure_redis_cache_hits", "varnish_cache_hit_rate"},
504+
"Cache misses": {"varnish_cache_miss_rate", "azure_redis_cache_misses"},
505+
"Cache hit ratio": {"azure_redis_cache_hit_ratio", "cache_hit_ratio"},
506+
"Memory utilization": {"memory_util", "azure_redis_memory_utilization"},
470507
}
471508

472509

@@ -520,18 +557,23 @@ def test_duplicate_metric_titles_fixed() -> None:
520557

521558

522559
_ALLOWED_DUPLICATE_GRAPH_TITLES = {
523-
"Huge pages": {"huge_pages_2", "huge_pages"},
524-
"Bandwidth": {"bandwidth_translated", "bandwidth"},
525-
# 'Traffic' is commented out b/c it *appears* fixed to this test (if you run via bazel).
526-
# This is caused by the netapp family being moved into the cmk-plugins package.
527-
# We may have to move this test to integration/cmk/plugins_consistency.
528-
# See also CMK-27183
529-
# "Traffic": {"read_write_data", "traffic"},
530-
"Disk latency": {"disk_latency", "disk_rw_latency"},
531560
"Access point statistics": {"access_point_statistics2", "access_point_statistics"},
532-
"VMalloc address space": {"vmalloc_address_space_2", "vmalloc_address_space_1"},
561+
"Bandwidth": {"bandwidth_translated", "bandwidth"},
533562
"Capacity usage": {"capacity_usage_2", "capacity_usage"},
563+
"Disk latency": {"disk_latency", "disk_rw_latency"},
564+
"Huge pages": {"huge_pages_2", "huge_pages"},
534565
"Packets": {"packets_1", "packets_2", "packets_3"},
566+
"Requests (Azure, CosmosDB)": {
567+
"azure_cosmosdb_database_container_requests",
568+
"azure_cosmosdb_database_requests",
569+
},
570+
"Throttled Requests Ratio": {
571+
"azure_cosmosdb_database_throttled_ratio",
572+
"azure_cosmosdb_database_container_throttled_ratio",
573+
},
574+
"Throughput": {"azure_natgateways_throughput_in_out", "azure_redis_throughput"},
575+
"Traffic": {"traffic", "read_write_data"},
576+
"VMalloc address space": {"vmalloc_address_space_2", "vmalloc_address_space_1"},
535577
}
536578

537579

tests/pylint/checker_cmk_module_layers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,9 +1063,7 @@ def _is_allowed(
10631063
"cmk.discover_plugins",
10641064
"cmk.gui",
10651065
"cmk.server_side_calls_backend",
1066-
"cmk.utils.check_utils",
1067-
"cmk.utils.man_pages",
1068-
"cmk.utils.rulesets",
1066+
"cmk.utils",
10691067
),
10701068
Component("tests.integration.cmk.base"): _allow(
10711069
*PACKAGE_CCC,

0 commit comments

Comments
 (0)