Skip to content

Commit

Permalink
Increase components test in the builder generated code (open-telemetr…
Browse files Browse the repository at this point in the history
…y#7027)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored Jan 26, 2023
1 parent af15118 commit ef609c2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
19 changes: 14 additions & 5 deletions cmd/builder/internal/builder/templates/components_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,28 @@ func TestValidateConfigs(t *testing.T) {
factories, err := components()
assert.NoError(t, err)

for _, factory := range factories.Receivers {
for k, factory := range factories.Receivers {
assert.Equal(t, k, factory.Type())
assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig()))
}
for _, factory := range factories.Processors {

for k, factory := range factories.Processors {
assert.Equal(t, k, factory.Type())
assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig()))
}
for _, factory := range factories.Exporters {

for k, factory := range factories.Exporters {
assert.Equal(t, k, factory.Type())
assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig()))
}
for _, factory := range factories.Extensions {

for k, factory := range factories.Connectors {
assert.Equal(t, k, factory.Type())
assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig()))
}
for _, factory := range factories.Connectors {

for k, factory := range factories.Extensions {
assert.Equal(t, k, factory.Type())
assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig()))
}
}
19 changes: 14 additions & 5 deletions cmd/otelcorecol/components_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ef609c2

Please sign in to comment.