diff --git a/cmd/jaeger/internal/.nocover b/cmd/jaeger/internal/.nocover deleted file mode 100644 index 46911e9377b..00000000000 --- a/cmd/jaeger/internal/.nocover +++ /dev/null @@ -1,2 +0,0 @@ -FIXME - diff --git a/cmd/jaeger/internal/command_test.go b/cmd/jaeger/internal/command_test.go new file mode 100644 index 00000000000..9d46dc32495 --- /dev/null +++ b/cmd/jaeger/internal/command_test.go @@ -0,0 +1,22 @@ +package internal + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestCommand(t *testing.T) { + cmd := Command() + + assert.NotNil(t, cmd, "Command() should return a non-nil *cobra.Command instance") + + expectedShortDescription := "Jaeger backend v2" + assert.Equal(t, expectedShortDescription, cmd.Short, "Command short description should be '%s'", expectedShortDescription) + + expectedLongDescription := "Jaeger backend v2" + assert.Equal(t, expectedLongDescription, cmd.Long, "Command long description should be '%s'", expectedLongDescription) + + assert.NotNil(t, cmd.RunE, "Command should have RunE function set") + +} diff --git a/cmd/jaeger/internal/components_test.go b/cmd/jaeger/internal/components_test.go new file mode 100644 index 00000000000..fad2fa50736 --- /dev/null +++ b/cmd/jaeger/internal/components_test.go @@ -0,0 +1,22 @@ +package internal + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestComponents(t *testing.T) { + factories, err := components() + + assert.NoError(t, err) + + assert.NotNil(t, factories.Extensions) + assert.NotNil(t, factories.Receivers) + assert.NotNil(t, factories.Exporters) + assert.NotNil(t, factories.Processors) + assert.NotNil(t, factories.Connectors) + + _, jaegerReceiverFactoryExists := factories.Receivers["jaeger"] + assert.True(t, jaegerReceiverFactoryExists) +}