Skip to content

Commit

Permalink
[chore] cleaning up references to logging exporter (#11011)
Browse files Browse the repository at this point in the history
These should have been updated to debug some time ago, but they're low
priority as they're just tests

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
  • Loading branch information
codeboten committed Aug 29, 2024
1 parent 5e29655 commit bee3e6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion confmap/internal/e2e/testdata/issue-10787-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ service:
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging]
exporters: [debug]
2 changes: 1 addition & 1 deletion confmap/internal/e2e/testdata/issue-10787-snippet.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# ${hello.world}
logging:
debug:
verbosity: detailed
24 changes: 12 additions & 12 deletions confmap/internal/e2e/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func TestIssue10787(t *testing.T) {
assert.Equal(t, conf.ToStringMap(),
map[string]any{
"exporters": map[string]any{
"logging": map[string]any{
"debug": map[string]any{
"verbosity": "detailed",
},
},
Expand All @@ -444,7 +444,7 @@ func TestIssue10787(t *testing.T) {
"service": map[string]any{
"pipelines": map[string]any{
"traces": map[string]any{
"exporters": []any{"logging"},
"exporters": []any{"debug"},
"processors": []any{"batch"},
"receivers": []any{"otlp"},
},
Expand All @@ -462,16 +462,16 @@ func TestIssue10787(t *testing.T) {
func TestStructMappingIssue10787(t *testing.T) {
resolver := NewResolver(t, "types_expand.yaml")
t.Setenv("ENV", `# this is a comment
logging:
debug:
verbosity: detailed`)
conf, err := resolver.Resolve(context.Background())
require.NoError(t, err)

type Logging struct {
type Debug struct {
Verbosity string `mapstructure:"verbosity"`
}
type Exporters struct {
Logging Logging `mapstructure:"logging"`
Debug Debug `mapstructure:"debug"`
}
type Target struct {
Field Exporters `mapstructure:"field"`
Expand All @@ -482,7 +482,7 @@ logging:
require.NoError(t, err)
require.Equal(t,
Target{Field: Exporters{
Logging: Logging{
Debug: Debug{
Verbosity: "detailed",
},
}},
Expand All @@ -495,7 +495,7 @@ logging:
err = confStr.Unmarshal(&cfgStr)
require.NoError(t, err)
require.Equal(t, `# this is a comment
logging:
debug:
verbosity: detailed`,
cfgStr.Field,
)
Expand All @@ -505,16 +505,16 @@ func TestStructMappingIssue10787_ExpandComment(t *testing.T) {
resolver := NewResolver(t, "types_expand.yaml")
t.Setenv("EXPAND_ME", "an expanded env var")
t.Setenv("ENV", `# this is a comment with ${EXPAND_ME}
logging:
debug:
verbosity: detailed`)
conf, err := resolver.Resolve(context.Background())
require.NoError(t, err)

type Logging struct {
type Debug struct {
Verbosity string `mapstructure:"verbosity"`
}
type Exporters struct {
Logging Logging `mapstructure:"logging"`
Debug Debug `mapstructure:"debug"`
}
type Target struct {
Field Exporters `mapstructure:"field"`
Expand All @@ -525,7 +525,7 @@ logging:
require.NoError(t, err)
require.Equal(t,
Target{Field: Exporters{
Logging: Logging{
Debug: Debug{
Verbosity: "detailed",
},
}},
Expand All @@ -538,7 +538,7 @@ logging:
err = confStr.Unmarshal(&cfgStr)
require.NoError(t, err)
require.Equal(t, `# this is a comment with an expanded env var
logging:
debug:
verbosity: detailed`,
cfgStr.Field,
)
Expand Down

0 comments on commit bee3e6a

Please sign in to comment.