Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Fix IDs in end to end k8s tests #38303

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions processor/k8sattributesprocessor/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"go.uber.org/multierr"

k8stest "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/xk8stest"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor/internal/metadata"
)

const (
Expand Down Expand Up @@ -1732,13 +1731,13 @@ func startUpSinks(t *testing.T, mc *consumertest.MetricsSink, tc *consumertest.T
cfg.HTTP = nil
cfg.GRPC.NetAddr.Endpoint = "0.0.0.0:4317"

_, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, mc)
_, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, mc)
require.NoError(t, err, "failed creating metrics receiver")
_, err = f.CreateTraces(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, tc)
_, err = f.CreateTraces(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, tc)
require.NoError(t, err, "failed creating traces receiver")
_, err = f.CreateLogs(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, lc)
_, err = f.CreateLogs(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, lc)
require.NoError(t, err, "failed creating logs receiver")
rcvr, err := f.(xreceiver.Factory).CreateProfiles(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, pc)
rcvr, err := f.(xreceiver.Factory).CreateProfiles(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, pc)
require.NoError(t, err, "failed creating profiles receiver")
require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
return func() {
Expand Down
5 changes: 2 additions & 3 deletions receiver/k8sclusterreceiver/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/plogtest"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest"
k8stest "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/xk8stest"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/metadata"
)

const (
Expand Down Expand Up @@ -266,9 +265,9 @@ func startUpSink(t *testing.T, consumer any) func() {

switch c := consumer.(type) {
case *consumertest.MetricsSink:
rcvr, err = f.CreateMetrics(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, c)
rcvr, err = f.CreateMetrics(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, c)
case *consumertest.LogsSink:
rcvr, err = f.CreateLogs(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, c)
rcvr, err = f.CreateLogs(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, c)
default:
t.Fatalf("unsupported consumer type: %T", c)
}
Expand Down
5 changes: 2 additions & 3 deletions receiver/k8sobjectsreceiver/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/plogtest"
k8stest "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/xk8stest"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sobjectsreceiver/internal/metadata"
)

const (
Expand Down Expand Up @@ -53,9 +52,9 @@ func TestE2E(t *testing.T) {
cfg.HTTP = nil
cfg.GRPC.NetAddr.Endpoint = "0.0.0.0:4317"
logsConsumer := new(consumertest.LogsSink)
rcvr, err := f.CreateLogs(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, logsConsumer)
require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
rcvr, err := f.CreateLogs(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, logsConsumer)
require.NoError(t, err, "failed creating logs receiver")
require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
defer func() {
assert.NoError(t, rcvr.Shutdown(context.Background()))
}()
Expand Down
5 changes: 2 additions & 3 deletions receiver/kubeletstatsreceiver/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest"
k8stest "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/xk8stest"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver/internal/metadata"
)

const testKubeConfig = "/tmp/kube-config-otelcol-e2e-testing"
Expand Down Expand Up @@ -72,9 +71,9 @@ func startUpSink(t *testing.T, mc *consumertest.MetricsSink) func() {
cfg.HTTP = nil
cfg.GRPC.NetAddr.Endpoint = "0.0.0.0:4317"

rcvr, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(metadata.Type), cfg, mc)
require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
rcvr, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(f.Type()), cfg, mc)
require.NoError(t, err, "failed creating metrics receiver")
require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
return func() {
assert.NoError(t, rcvr.Shutdown(context.Background()))
}
Expand Down
Loading