-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathtest_config_reader.py
More file actions
64 lines (55 loc) · 1.93 KB
/
Copy pathtest_config_reader.py
File metadata and controls
64 lines (55 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# (c) Copyright IBM Corp. 2025
import logging
import pytest
from instana.util.config import parse_ignored_endpoints_from_yaml
class TestConfigReader:
def test_load_configuration_with_tracing(
self, caplog: pytest.LogCaptureFixture
) -> None:
caplog.set_level(logging.DEBUG, logger="instana")
ignore_endpoints = parse_ignored_endpoints_from_yaml(
"tests/util/test_configuration-1.yaml"
)
# test with tracing
assert ignore_endpoints == [
"redis.get",
"redis.type",
"dynamodb.query",
"kafka.consume.span-topic",
"kafka.consume.topic1",
"kafka.consume.topic2",
"kafka.send.span-topic",
"kafka.send.topic1",
"kafka.send.topic2",
"kafka.consume.topic3",
"kafka.*.span-topic",
"kafka.*.topic4",
]
assert (
'Please use "tracing" instead of "com.instana.tracing" for local configuration file.'
not in caplog.messages
)
def test_load_configuration_legacy(self, caplog: pytest.LogCaptureFixture) -> None:
caplog.set_level(logging.DEBUG, logger="instana")
ignore_endpoints = parse_ignored_endpoints_from_yaml(
"tests/util/test_configuration-2.yaml"
)
assert ignore_endpoints == [
"redis.get",
"redis.type",
"dynamodb.query",
"kafka.send.*",
"kafka.consume.span-topic",
"kafka.consume.topic1",
"kafka.consume.topic2",
"kafka.send.span-topic",
"kafka.send.topic1",
"kafka.send.topic2",
"kafka.consume.topic3",
"kafka.*.span-topic",
"kafka.*.topic4",
]
assert (
'Please use "tracing" instead of "com.instana.tracing" for local configuration file.'
in caplog.messages
)