From a4b7d0b33c229390ddcab6f37abf05206e3d1160 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 27 Aug 2021 09:20:04 -0700 Subject: [PATCH] Move testutil to internal, copied in contrib as well Signed-off-by: Bogdan Drutu --- exporter/otlpexporter/factory_test.go | 2 +- exporter/otlphttpexporter/factory_test.go | 2 +- exporter/otlphttpexporter/otlp_test.go | 2 +- extension/pprofextension/factory_test.go | 2 +- extension/pprofextension/pprofextension_test.go | 2 +- extension/zpagesextension/factory_test.go | 2 +- extension/zpagesextension/zpagesextension_test.go | 2 +- internal/middleware/compression_test.go | 2 +- {testutil => internal/testutil}/testutil.go | 0 {testutil => internal/testutil}/testutil_test.go | 0 receiver/otlpreceiver/factory_test.go | 2 +- receiver/otlpreceiver/otlp_test.go | 2 +- service/collector_test.go | 2 +- service/defaultcomponents/default_exporters_test.go | 2 +- service/defaultcomponents/default_extensions_test.go | 2 +- service/defaultcomponents/default_receivers_test.go | 2 +- 16 files changed, 14 insertions(+), 14 deletions(-) rename {testutil => internal/testutil}/testutil.go (100%) rename {testutil => internal/testutil}/testutil_test.go (100%) diff --git a/exporter/otlpexporter/factory_test.go b/exporter/otlpexporter/factory_test.go index fbb97c7005e..139deb02b1e 100644 --- a/exporter/otlpexporter/factory_test.go +++ b/exporter/otlpexporter/factory_test.go @@ -28,7 +28,7 @@ import ( "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/exporter/exporterhelper" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestCreateDefaultConfig(t *testing.T) { diff --git a/exporter/otlphttpexporter/factory_test.go b/exporter/otlphttpexporter/factory_test.go index 47973b6ec41..107c565fde0 100644 --- a/exporter/otlphttpexporter/factory_test.go +++ b/exporter/otlphttpexporter/factory_test.go @@ -27,7 +27,7 @@ import ( "go.opentelemetry.io/collector/config/configcheck" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/configtls" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestCreateDefaultConfig(t *testing.T) { diff --git a/exporter/otlphttpexporter/otlp_test.go b/exporter/otlphttpexporter/otlp_test.go index c4511ddf725..cd38f220714 100644 --- a/exporter/otlphttpexporter/otlp_test.go +++ b/exporter/otlphttpexporter/otlp_test.go @@ -38,9 +38,9 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/internal/testdata" + "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/model/pdata" "go.opentelemetry.io/collector/receiver/otlpreceiver" - "go.opentelemetry.io/collector/testutil" ) func TestInvalidConfig(t *testing.T) { diff --git a/extension/pprofextension/factory_test.go b/extension/pprofextension/factory_test.go index d5dacc969f0..700f6cd6205 100644 --- a/extension/pprofextension/factory_test.go +++ b/extension/pprofextension/factory_test.go @@ -25,7 +25,7 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configcheck" "go.opentelemetry.io/collector/config/confignet" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestFactory_CreateDefaultConfig(t *testing.T) { diff --git a/extension/pprofextension/pprofextension_test.go b/extension/pprofextension/pprofextension_test.go index 17f9272a9f5..50e15b51e71 100644 --- a/extension/pprofextension/pprofextension_test.go +++ b/extension/pprofextension/pprofextension_test.go @@ -28,7 +28,7 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/confignet" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestPerformanceProfilerExtensionUsage(t *testing.T) { diff --git a/extension/zpagesextension/factory_test.go b/extension/zpagesextension/factory_test.go index 37ef2f9d065..c3ac261a03c 100644 --- a/extension/zpagesextension/factory_test.go +++ b/extension/zpagesextension/factory_test.go @@ -25,7 +25,7 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configcheck" "go.opentelemetry.io/collector/config/confignet" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestFactory_CreateDefaultConfig(t *testing.T) { diff --git a/extension/zpagesextension/zpagesextension_test.go b/extension/zpagesextension/zpagesextension_test.go index fb3d376b162..4df59e0b088 100644 --- a/extension/zpagesextension/zpagesextension_test.go +++ b/extension/zpagesextension/zpagesextension_test.go @@ -28,7 +28,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/confignet" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) type zpagesHost struct { diff --git a/internal/middleware/compression_test.go b/internal/middleware/compression_test.go index b49cdb1ef12..f35a5931c37 100644 --- a/internal/middleware/compression_test.go +++ b/internal/middleware/compression_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestHTTPClientCompression(t *testing.T) { diff --git a/testutil/testutil.go b/internal/testutil/testutil.go similarity index 100% rename from testutil/testutil.go rename to internal/testutil/testutil.go diff --git a/testutil/testutil_test.go b/internal/testutil/testutil_test.go similarity index 100% rename from testutil/testutil_test.go rename to internal/testutil/testutil_test.go diff --git a/receiver/otlpreceiver/factory_test.go b/receiver/otlpreceiver/factory_test.go index 057da3ac577..388cb72bd0a 100644 --- a/receiver/otlpreceiver/factory_test.go +++ b/receiver/otlpreceiver/factory_test.go @@ -29,7 +29,7 @@ import ( "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestCreateDefaultConfig(t *testing.T) { diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 0395344386a..06d173e2eed 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -47,11 +47,11 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/internal/internalconsumertest" "go.opentelemetry.io/collector/internal/testdata" + "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/model/otlp" "go.opentelemetry.io/collector/model/otlpgrpc" "go.opentelemetry.io/collector/model/pdata" "go.opentelemetry.io/collector/obsreport/obsreporttest" - "go.opentelemetry.io/collector/testutil" conventions "go.opentelemetry.io/collector/translator/conventions/v1.5.0" ) diff --git a/service/collector_test.go b/service/collector_test.go index d4ce2029969..dcc0262dbb2 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -36,10 +36,10 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configparser" "go.opentelemetry.io/collector/config/configunmarshaler" + "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/service/defaultcomponents" "go.opentelemetry.io/collector/service/internal/builder" "go.opentelemetry.io/collector/service/parserprovider" - "go.opentelemetry.io/collector/testutil" ) func TestCollector_Start(t *testing.T) { diff --git a/service/defaultcomponents/default_exporters_test.go b/service/defaultcomponents/default_exporters_test.go index 6e88220a4b2..81f3d7bef6d 100644 --- a/service/defaultcomponents/default_exporters_test.go +++ b/service/defaultcomponents/default_exporters_test.go @@ -30,7 +30,7 @@ import ( "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/exporter/otlpexporter" "go.opentelemetry.io/collector/exporter/otlphttpexporter" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestDefaultExporters(t *testing.T) { diff --git a/service/defaultcomponents/default_extensions_test.go b/service/defaultcomponents/default_extensions_test.go index d6f22e2fff5..05ea1f632d5 100644 --- a/service/defaultcomponents/default_extensions_test.go +++ b/service/defaultcomponents/default_extensions_test.go @@ -27,7 +27,7 @@ import ( "go.opentelemetry.io/collector/extension/ballastextension" "go.opentelemetry.io/collector/extension/pprofextension" "go.opentelemetry.io/collector/extension/zpagesextension" - "go.opentelemetry.io/collector/testutil" + "go.opentelemetry.io/collector/internal/testutil" ) func TestDefaultExtensions(t *testing.T) { diff --git a/service/defaultcomponents/default_receivers_test.go b/service/defaultcomponents/default_receivers_test.go index e0a7b3deeec..28e3819dfad 100644 --- a/service/defaultcomponents/default_receivers_test.go +++ b/service/defaultcomponents/default_receivers_test.go @@ -27,8 +27,8 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/receiver/otlpreceiver" - "go.opentelemetry.io/collector/testutil" ) func TestDefaultReceivers(t *testing.T) {