Skip to content

Commit

Permalink
mock otel collector
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveromahony committed Dec 2, 2024
1 parent d6d51a7 commit bc69c34
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/collector/otel_collector_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ func TestCollector_updateExistingNginxOSSReceiver(t *testing.T) {
collector, err := New(conf)
require.NoError(tt, err, "NewCollector should not return an error with valid config")

collector.service = createFakeCollector()

nginxReceiverFound, reloadCollector := collector.updateExistingNginxOSSReceiver(test.nginxConfigContext)

assert.True(tt, nginxReceiverFound)
Expand Down Expand Up @@ -580,6 +582,8 @@ func TestCollector_updateExistingNginxPlusReceiver(t *testing.T) {
collector, err := New(conf)
require.NoError(tt, err, "NewCollector should not return an error with valid config")

collector.service = createFakeCollector()

nginxReceiverFound, reloadCollector := collector.updateExistingNginxPlusReceiver(test.nginxConfigContext)

assert.True(tt, nginxReceiverFound)
Expand Down Expand Up @@ -633,6 +637,8 @@ func TestCollector_updateResourceAttributes(t *testing.T) {
collector, err := New(conf)
require.NoError(tt, err, "NewCollector should not return an error with valid config")

collector.service = createFakeCollector()

// set up Actions
conf.Collector.Processors.Resource = &config.Resource{Attributes: test.setup}

Expand Down

0 comments on commit bc69c34

Please sign in to comment.