Skip to content

Commit

Permalink
[chore] [cmd/otelcontribcol] Simplify and fix receivers lifecycle tes…
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax authored Oct 17, 2023
1 parent c878560 commit 5196fd4
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions cmd/otelcontribcol/receivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ func TestDefaultReceivers(t *testing.T) {
receiver: "docker_stats",
skipLifecyle: true,
},
{
receiver: "dotnet_diagnostics",
skipLifecyle: true, // Requires a running .NET process to examine
},
{
receiver: "elasticsearch",
},
Expand Down Expand Up @@ -326,10 +322,6 @@ func TestDefaultReceivers(t *testing.T) {
return cfg
},
},
{
receiver: "prometheus_exec",
skipLifecyle: true, // Requires running a subproccess that can not be easily set across platforms
},
{
receiver: "pulsar",
skipLifecyle: true, // TODO It requires a running pulsar instance to start successfully.
Expand All @@ -355,9 +347,6 @@ func TestDefaultReceivers(t *testing.T) {
{
receiver: "sapm",
},
{
receiver: "saphana",
},
{
receiver: "signalfx",
},
Expand Down Expand Up @@ -464,15 +453,8 @@ func TestDefaultReceivers(t *testing.T) {
},
}

receiverCount := 0
assert.Equal(t, len(rcvrFactories), len(tests), "All receivers must be added to the lifecycle suite")
for _, tt := range tests {
_, ok := rcvrFactories[tt.receiver]
if !ok {
// not part of the distro, skipping.
continue
}
tt := tt
receiverCount++
t.Run(string(tt.receiver), func(t *testing.T) {
factory := rcvrFactories[tt.receiver]
assert.Equal(t, tt.receiver, factory.Type())
Expand All @@ -486,10 +468,8 @@ func TestDefaultReceivers(t *testing.T) {
}
verifyReceiverLifecycle(t, factory, tt.getConfigFn)
})

})
}
assert.Len(t, rcvrFactories, receiverCount, "All receivers must be added to the lifecycle suite")
}

// getReceiverConfigFn is used customize the configuration passed to the verification.
Expand Down

0 comments on commit 5196fd4

Please sign in to comment.