Skip to content

Commit

Permalink
Revert "OTEL: Add basic config"
Browse files Browse the repository at this point in the history
This reverts commit 49c58d9.
  • Loading branch information
si-23 committed Dec 3, 2024
1 parent 465a368 commit ceb91a8
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
init-hook=
import sys;
sys.path.insert(0, __file__[:__file__.rfind("/.venv")]); # __file__ is somewhere deep inside the .venv
from tests.testlib.repo import add_protocols_path, add_otel_path, add_python_paths;
from tests.testlib.repo import add_protocols_path, add_python_paths;
add_protocols_path();
add_otel_path();
add_python_paths();
load-plugins=
tests.pylint.cmk_edition_ignores,
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ mypy_path = """\
$MYPY_CONFIG_FILE_DIR:\
$MYPY_CONFIG_FILE_DIR/non-free/cmc-protocols:\
$MYPY_CONFIG_FILE_DIR/non-free/cmk-update-agent:\
$MYPY_CONFIG_FILE_DIR/non-free/packages/cmk-otel:\
$MYPY_CONFIG_FILE_DIR/livestatus/api/python:\
$MYPY_CONFIG_FILE_DIR/omd/packages/omd:\
$MYPY_CONFIG_FILE_DIR/tests/typeshed:\
Expand Down
44 changes: 44 additions & 0 deletions tests/integration/omd/test_otel_collector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python3
# Copyright (C) 2024 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

from pathlib import Path

import pytest

from tests.testlib.site import Site
from tests.testlib.version import version_from_env

# Apply the skipif marker to all tests in this file for non Managed or Cloud edition
pytestmark = [
pytest.mark.skipif(
True
not in [version_from_env().is_cloud_edition(), version_from_env().is_managed_edition()],
reason="otel-collector only shipped with Cloud or Managed",
)
]


def test_otel_collector_exists(site: Site) -> None:
assert Path(site.root, "bin", "otelcol").exists()


@pytest.mark.parametrize(
"command",
[
["otelcol", "--help"],
["otelcol", "components"],
],
)
def test_otel_collector_command_availability(site: Site, command: list[str]) -> None:
# Commands executed here should return with exit code 0
site.check_output(command)


def test_otel_collector_version(site: Site) -> None:
cmd = [
"otelcol",
"--version",
]
assert "0.113.0" in site.check_output(cmd)
1 change: 0 additions & 1 deletion tests/pylint/checker_cmk_module_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def _is_allowed_import(imported: ModuleName) -> bool:
_in_component(imported=imported, component=Component("cmk.graphing")),
_in_component(imported=imported, component=Component("cmk.trace")),
_in_component(imported=imported, component=Component("cmk.events")),
_in_component(imported=imported, component=Component("cmk.otel")),
)
)

Expand Down
6 changes: 0 additions & 6 deletions tests/testlib/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ def add_protocols_path():
sys.path.insert(0, os.path.join(repo_path(), "non-free", "cmc-protocols"))


def add_otel_path():
sys.path.insert(0, str(repo_path()))
if is_cloud_repo():
sys.path.insert(0, os.path.join(repo_path(), "non-free", "packages", "cmk-otel"))


@cache
def qa_test_data_path() -> Path:
return Path(__file__).parent.parent.resolve() / Path("qa-test-data")
Expand Down

0 comments on commit ceb91a8

Please sign in to comment.