Skip to content

Commit

Permalink
Fix unit tests and linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Oct 2, 2023
1 parent 129652a commit 4bae072
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions component/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import (
_ "github.com/grafana/agent/component/otelcol/processor/probabilistic_sampler" // Import otelcol.processor.probabilistic_sampler
_ "github.com/grafana/agent/component/otelcol/processor/span" // Import otelcol.processor.span
_ "github.com/grafana/agent/component/otelcol/processor/tail_sampling" // Import otelcol.processor.tail_sampling
_ "github.com/grafana/agent/component/otelcol/processor/transform" // Import otelcol.processor.transform
_ "github.com/grafana/agent/component/otelcol/receiver/jaeger" // Import otelcol.receiver.jaeger
_ "github.com/grafana/agent/component/otelcol/receiver/kafka" // Import otelcol.receiver.kafka
_ "github.com/grafana/agent/component/otelcol/receiver/loki" // Import otelcol.receiver.loki
Expand Down
12 changes: 6 additions & 6 deletions component/otelcol/processor/transform/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func TestArguments_UnmarshalRiver(t *testing.T) {
}
output {}
`,
errorMsg: `unable to parse OTTL statement: 1:18: unexpected token "where" (expected ")" Key*)`,
errorMsg: `unable to parse OTTL statement "set(body, \"bear\" where attributes[\"http.path\"] == \"/animal\"": statement has invalid syntax: 1:18: unexpected token "where" (expected ")" Key*)`,
},
{
testName: "bad_syntax_metric",
Expand All @@ -445,7 +445,7 @@ func TestArguments_UnmarshalRiver(t *testing.T) {
}
output {}
`,
errorMsg: `unable to parse OTTL statement: 1:18: unexpected token "where" (expected ")" Key*)`,
errorMsg: `unable to parse OTTL statement "set(name, \"bear\" where attributes[\"http.path\"] == \"/animal\"": statement has invalid syntax: 1:18: unexpected token "where" (expected ")" Key*)`,
},
{
testName: "bad_syntax_trace",
Expand All @@ -459,7 +459,7 @@ func TestArguments_UnmarshalRiver(t *testing.T) {
}
output {}
`,
errorMsg: `unable to parse OTTL statement: 1:18: unexpected token "where" (expected ")" Key*)`,
errorMsg: `unable to parse OTTL statement "set(name, \"bear\" where attributes[\"http.path\"] == \"/animal\"": statement has invalid syntax: 1:18: unexpected token "where" (expected ")" Key*)`,
},
{
testName: "unknown_function_log",
Expand All @@ -473,7 +473,7 @@ func TestArguments_UnmarshalRiver(t *testing.T) {
}
output {}
`,
errorMsg: `undefined function not_a_function`,
errorMsg: `unable to parse OTTL statement "not_a_function(attributes, [\"http.method\", \"http.path\"])": undefined function "not_a_function"`,
},
{
testName: "unknown_function_metric",
Expand All @@ -487,7 +487,7 @@ func TestArguments_UnmarshalRiver(t *testing.T) {
}
output {}
`,
errorMsg: `undefined function not_a_function`,
errorMsg: `unable to parse OTTL statement "not_a_function(attributes, [\"http.method\", \"http.path\"])": undefined function "not_a_function"`,
},
{
testName: "unknown_function_trace",
Expand All @@ -501,7 +501,7 @@ func TestArguments_UnmarshalRiver(t *testing.T) {
}
output {}
`,
errorMsg: `undefined function not_a_function`,
errorMsg: `unable to parse OTTL statement "not_a_function(attributes, [\"http.method\", \"http.path\"])": undefined function "not_a_function"`,
},
{
testName: "unknown_context",
Expand Down

0 comments on commit 4bae072

Please sign in to comment.