@@ -34,12 +34,12 @@ import (
34
34
"go.uber.org/zap/zapcore"
35
35
36
36
"go.opentelemetry.io/collector/component"
37
- "go.opentelemetry.io/collector/component/componenttest"
38
37
"go.opentelemetry.io/collector/confmap"
39
38
"go.opentelemetry.io/collector/extension/zpagesextension"
40
39
"go.opentelemetry.io/collector/featuregate"
41
40
"go.opentelemetry.io/collector/internal/obsreportconfig"
42
41
"go.opentelemetry.io/collector/internal/testutil"
42
+ "go.opentelemetry.io/collector/service/servicetest"
43
43
)
44
44
45
45
func TestStateString (t * testing.T ) {
@@ -51,7 +51,7 @@ func TestStateString(t *testing.T) {
51
51
}
52
52
53
53
func TestCollectorStartAsGoRoutine (t * testing.T ) {
54
- factories , err := componenttest .NopFactories ()
54
+ factories , err := servicetest .NopFactories ()
55
55
require .NoError (t , err )
56
56
57
57
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-nop.yaml" )}))
@@ -79,7 +79,7 @@ func TestCollectorStartAsGoRoutine(t *testing.T) {
79
79
}
80
80
81
81
func TestCollectorCancelContext (t * testing.T ) {
82
- factories , err := componenttest .NopFactories ()
82
+ factories , err := servicetest .NopFactories ()
83
83
require .NoError (t , err )
84
84
85
85
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-nop.yaml" )}))
@@ -116,7 +116,7 @@ func (p mockCfgProvider) Watch() <-chan error {
116
116
}
117
117
118
118
func TestCollectorStateAfterConfigChange (t * testing.T ) {
119
- factories , err := componenttest .NopFactories ()
119
+ factories , err := servicetest .NopFactories ()
120
120
require .NoError (t , err )
121
121
122
122
provider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-nop.yaml" )}))
@@ -150,7 +150,7 @@ func TestCollectorStateAfterConfigChange(t *testing.T) {
150
150
}
151
151
152
152
func TestCollectorReportError (t * testing.T ) {
153
- factories , err := componenttest .NopFactories ()
153
+ factories , err := servicetest .NopFactories ()
154
154
require .NoError (t , err )
155
155
156
156
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-nop.yaml" )}))
@@ -177,7 +177,7 @@ func TestCollectorReportError(t *testing.T) {
177
177
}
178
178
179
179
func TestCollectorSendSignal (t * testing.T ) {
180
- factories , err := componenttest .NopFactories ()
180
+ factories , err := servicetest .NopFactories ()
181
181
require .NoError (t , err )
182
182
183
183
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-nop.yaml" )}))
@@ -211,7 +211,7 @@ func TestCollectorSendSignal(t *testing.T) {
211
211
212
212
func TestCollectorFailedShutdown (t * testing.T ) {
213
213
t .Skip ("This test was using telemetry shutdown failure, switch to use a component that errors on shutdown." )
214
- factories , err := componenttest .NopFactories ()
214
+ factories , err := servicetest .NopFactories ()
215
215
require .NoError (t , err )
216
216
217
217
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-nop.yaml" )}))
@@ -243,7 +243,7 @@ func TestCollectorFailedShutdown(t *testing.T) {
243
243
}
244
244
245
245
func TestCollectorStartInvalidConfig (t * testing.T ) {
246
- factories , err := componenttest .NopFactories ()
246
+ factories , err := servicetest .NopFactories ()
247
247
require .NoError (t , err )
248
248
249
249
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-invalid.yaml" )}))
@@ -361,7 +361,7 @@ func ownMetricsTestCases(version string) []ownMetricsTestCase {
361
361
}
362
362
363
363
func testCollectorStartHelper (t * testing.T , telemetry * telemetryInitializer , tc ownMetricsTestCase ) {
364
- factories , err := componenttest .NopFactories ()
364
+ factories , err := servicetest .NopFactories ()
365
365
zpagesExt := zpagesextension .NewFactory ()
366
366
factories .Extensions [zpagesExt .Type ()] = zpagesExt
367
367
require .NoError (t , err )
@@ -455,7 +455,7 @@ func TestCollectorStartWithTraceContextPropagation(t *testing.T) {
455
455
456
456
for _ , tt := range tests {
457
457
t .Run (tt .file , func (t * testing.T ) {
458
- factories , err := componenttest .NopFactories ()
458
+ factories , err := servicetest .NopFactories ()
459
459
require .NoError (t , err )
460
460
461
461
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , tt .file )}))
@@ -494,7 +494,7 @@ func TestCollectorRun(t *testing.T) {
494
494
495
495
for _ , tt := range tests {
496
496
t .Run (tt .file , func (t * testing.T ) {
497
- factories , err := componenttest .NopFactories ()
497
+ factories , err := servicetest .NopFactories ()
498
498
require .NoError (t , err )
499
499
500
500
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , tt .file )}))
@@ -519,7 +519,7 @@ func TestCollectorRun(t *testing.T) {
519
519
}
520
520
521
521
func TestCollectorShutdownBeforeRun (t * testing.T ) {
522
- factories , err := componenttest .NopFactories ()
522
+ factories , err := servicetest .NopFactories ()
523
523
require .NoError (t , err )
524
524
525
525
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-nop.yaml" )}))
@@ -545,7 +545,7 @@ func TestCollectorShutdownBeforeRun(t *testing.T) {
545
545
}
546
546
547
547
func TestCollectorClosedStateOnStartUpError (t * testing.T ) {
548
- factories , err := componenttest .NopFactories ()
548
+ factories , err := servicetest .NopFactories ()
549
549
require .NoError (t , err )
550
550
551
551
cfgProvider , err := NewConfigProvider (newDefaultConfigProviderSettings ([]string {filepath .Join ("testdata" , "otelcol-invalid.yaml" )}))
0 commit comments